diff options
-rw-r--r-- | Xamarin.Forms.Core/MessagingCenter.cs | 2 | ||||
-rw-r--r-- | Xamarin.Forms.Pages/DataSourceBinding.cs | 7 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.WP8/NavigationMenuRenderer.cs | 5 |
3 files changed, 6 insertions, 8 deletions
diff --git a/Xamarin.Forms.Core/MessagingCenter.cs b/Xamarin.Forms.Core/MessagingCenter.cs index 973531ab..0efb3a37 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 44af47b4..7491ca30 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 c5a983d3..83af320b 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(); }; |