summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8
diff options
context:
space:
mode:
authoradrianknight89 <adrianknight89@outlook.com>2016-11-24 13:34:46 -0600
committerStephane Delcroix <stephane@delcroix.org>2016-11-24 20:34:46 +0100
commit1f3d5ecd260c836563b34efe2be3f8e287582eaf (patch)
tree640e183debe00384e74b7c35a169417c136ec869 /Xamarin.Forms.Platform.WP8
parent57152381377d2b09f749f46b829add58f1ab1930 (diff)
downloadxamarin-forms-1f3d5ecd260c836563b34efe2be3f8e287582eaf.tar.gz
xamarin-forms-1f3d5ecd260c836563b34efe2be3f8e287582eaf.tar.bz2
xamarin-forms-1f3d5ecd260c836563b34efe2be3f8e287582eaf.zip
fix weakreferences (#558)
Diffstat (limited to 'Xamarin.Forms.Platform.WP8')
-rw-r--r--Xamarin.Forms.Platform.WP8/NavigationMenuRenderer.cs5
1 files changed, 3 insertions, 2 deletions
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();
};