summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.Forms.Core/MessagingCenter.cs2
-rw-r--r--Xamarin.Forms.Pages/DataSourceBinding.cs7
-rw-r--r--Xamarin.Forms.Platform.WP8/NavigationMenuRenderer.cs5
3 files changed, 6 insertions, 8 deletions
diff --git a/Xamarin.Forms.Core/MessagingCenter.cs b/Xamarin.Forms.Core/MessagingCenter.cs
index 973531a..0efb3a3 100644
--- a/Xamarin.Forms.Core/MessagingCenter.cs
+++ b/Xamarin.Forms.Core/MessagingCenter.cs
@@ -91,7 +91,7 @@ namespace Xamarin.Forms
List<Tuple<WeakReference, Action<object, object>>> actionsCopy = actions.ToList();
foreach (Tuple<WeakReference, Action<object, object>> action in actionsCopy)
{
- if (action.Item1.IsAlive && actions.Contains(action))
+ if (action.Item1.Target != null && actions.Contains(action))
action.Item2(sender, args);
}
}
diff --git a/Xamarin.Forms.Pages/DataSourceBinding.cs b/Xamarin.Forms.Pages/DataSourceBinding.cs
index 44af47b..7491ca3 100644
--- a/Xamarin.Forms.Pages/DataSourceBinding.cs
+++ b/Xamarin.Forms.Pages/DataSourceBinding.cs
@@ -120,11 +120,8 @@ namespace Xamarin.Forms.Pages
{
base.Unapply();
- if (_dataSourceRef != null && _dataSourceRef.IsAlive)
- {
- var dataSourceProviderer = (IDataSourceProvider)_dataSourceRef.Target;
- dataSourceProviderer?.UnmaskKey(_path);
- }
+ var dataSourceProviderer = (IDataSourceProvider)_dataSourceRef?.Target;
+ dataSourceProviderer?.UnmaskKey(_path);
_expression?.Unapply();
}
diff --git a/Xamarin.Forms.Platform.WP8/NavigationMenuRenderer.cs b/Xamarin.Forms.Platform.WP8/NavigationMenuRenderer.cs
index c5a983d..83af320 100644
--- a/Xamarin.Forms.Platform.WP8/NavigationMenuRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/NavigationMenuRenderer.cs
@@ -72,8 +72,9 @@ namespace Xamarin.Forms.Platform.WinPhone
var weakRef = new WeakReference(hubTile);
SizeChanged += (sender, args) =>
{
- if (weakRef.IsAlive)
- ((HubTile)weakRef.Target).Size = GetSize();
+ var hTile = (HubTile)weakRef.Target;
+ if (hTile != null)
+ hTile.Size = GetSize();
((IVisualElementController)Element).NativeSizeChanged();
};