Skip to content

Commit

Permalink
https://github.com/AndreiMisiukevich/HotReload/issues/132
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiMisiukevich committed Apr 14, 2020
1 parent bfd8fe2 commit ddc2396
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Reloader/Xamarin.Forms.HotReload.Reloader/HotReloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ private void ReloadElement(object obj, ReloadItem reloadItem, Type csharpType =
layout.Children.Remove(view);
break;
case ContentPage page:
page.Content = view;
page.Content = newView;
break;
}
break;
Expand Down
12 changes: 6 additions & 6 deletions Sample/Xamarin.Forms.HotReload.Sample/Pages/CodePage.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
using System;

using Xamarin.Forms;
using Xamarin.Forms.HotReload.Sample.Pages.Views;

namespace Xamarin.Forms.HotReload.Sample.Pages
{
public class CodePage : ContentPage
{
public CodePage()
{
BackgroundColor = Color.Red;
Content = new StackLayout
{
Children = {
new Label {
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
Text = "Hello ContentPage!!!!"
}
Children =
{
new CustomContentView(),
new Button { Text = "Click", BackgroundColor = Color.White }
}
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;

using Xamarin.Forms;

namespace Xamarin.Forms.HotReload.Sample.Pages.Views
{
public class CustomContentView : ContentView
{
public CustomContentView()
{
Margin = new Thickness(50);
BackgroundColor = Color.Yellow;
VerticalOptions = LayoutOptions.FillAndExpand;
HorizontalOptions = LayoutOptions.FillAndExpand;

Content = new Label
{
Text = "HI Xamarin!",
VerticalOptions = LayoutOptions.CenterAndExpand
};
}
}
}

0 comments on commit ddc2396

Please sign in to comment.