Skip to content

Commit

Permalink
code reload fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiMisiukevich committed Apr 14, 2020
1 parent aa970ff commit 440a841
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Reloader/Xamarin.Forms.HotReload.Reloader/HotReloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ private void ReloadElement(object obj, ReloadItem reloadItem, Type csharpType =
{
var prop = obj.GetType().GetProperty("HotReloadCtorParams", BindingFlags.Instance | BindingFlags.NonPublic)
?? obj.GetType().GetProperty("HotReloadCtorParams", BindingFlags.Instance | BindingFlags.Public);
var parameters = prop?.GetValue(obj) ?? new object[0];
var parameters = (prop?.GetValue(obj) as object[]) ?? new object[0];
switch (obj)
{
case Page page:
Expand Down Expand Up @@ -685,7 +685,7 @@ private void ReloadElement(object obj, ReloadItem reloadItem, Type csharpType =
}
}
}
catch
catch(Exception ex)
{
Console.WriteLine("### HOTRELOAD ERROR: CANNOT RELOAD C# CODE ###");
}
Expand Down Expand Up @@ -1178,7 +1178,7 @@ private void OnLoaded(object element, bool isReloaded)
{
var method = element.GetType().GetMethod("OnHotReloaded", BindingFlags.Instance | BindingFlags.NonPublic)
?? element.GetType().GetMethod("OnHotReloaded", BindingFlags.Instance | BindingFlags.Public);
method?.Invoke(element, null);
method?.Invoke(element, new object[0]);
}
}
catch (Exception ex)
Expand Down
2 changes: 1 addition & 1 deletion Sample/Xamarin.Forms.HotReload.Sample/Pages/CodePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public CodePage()
new Label {
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
Text = "Hello ContentPage!!!!!"
Text = "Hello ContentPage!!!!"
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions Sample/Xamarin.Forms.HotReload.Sample/Pages/ItemsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
color: red;
font-size: 20;
}
]]>
]]>
</StyleSheet>

<StyleSheet Source="../Assets/styles.css" />
Expand All @@ -36,7 +36,7 @@
SelectionMode="None"
VerticalOptions="FillAndExpand"
ItemTapped="OnItemTapped"
RowHeight="180"
RowHeight="180"
BackgroundColor="{StaticResource ListBgColor}"
ItemsSource="{Binding Items}">
<ListView.ItemTemplate>
Expand Down

0 comments on commit 440a841

Please sign in to comment.