summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-09-27 13:50:02 (GMT)
committerRui Marinho <me@ruimarinho.net>2016-09-27 13:50:02 (GMT)
commit53e1d99a751e7a9cb8ae3f67ac8f3630b2aea398 (patch)
tree7379dd4d3419a69018e4db910936a8cf146f33f5 /Xamarin.Forms.Controls
parentc83c830c68bc0da08f330457dc6901f1657b86f5 (diff)
downloadxamarin-forms-53e1d99a751e7a9cb8ae3f67ac8f3630b2aea398.zip
xamarin-forms-53e1d99a751e7a9cb8ae3f67ac8f3630b2aea398.tar.gz
xamarin-forms-53e1d99a751e7a9cb8ae3f67ac8f3630b2aea398.tar.bz2
Fix potential NRE accessing current application via Page.RealParent (#330)
* Fix potential NRE accessing current application via Page.RealParent * Update Native Bindings Gallery to use MessagingCenter
Diffstat (limited to 'Xamarin.Forms.Controls')
-rw-r--r--Xamarin.Forms.Controls/ControlGalleryPages/NativeBindingGalleryPage.cs8
-rw-r--r--Xamarin.Forms.Controls/ControlGalleryPages/NestedNativeControlGalleryPage.cs8
2 files changed, 16 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/NativeBindingGalleryPage.cs b/Xamarin.Forms.Controls/ControlGalleryPages/NativeBindingGalleryPage.cs
index 51d9b97..2941b4b 100644
--- a/Xamarin.Forms.Controls/ControlGalleryPages/NativeBindingGalleryPage.cs
+++ b/Xamarin.Forms.Controls/ControlGalleryPages/NativeBindingGalleryPage.cs
@@ -10,6 +10,14 @@ namespace Xamarin.Forms.Controls
NestedNativeViewModel ViewModel { get; set; }
+ public const string ReadyForNativeBindingsMessage = "ReadyForNativeBindings";
+
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+ MessagingCenter.Send(this, ReadyForNativeBindingsMessage);
+ }
+
public NativeBindingGalleryPage()
{
diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/NestedNativeControlGalleryPage.cs b/Xamarin.Forms.Controls/ControlGalleryPages/NestedNativeControlGalleryPage.cs
index 9f59660..d93d2d6 100644
--- a/Xamarin.Forms.Controls/ControlGalleryPages/NestedNativeControlGalleryPage.cs
+++ b/Xamarin.Forms.Controls/ControlGalleryPages/NestedNativeControlGalleryPage.cs
@@ -6,6 +6,14 @@ namespace Xamarin.Forms.Controls
public bool NativeControlsAdded { get; set; }
+ public const string ReadyForNativeControlsMessage = "ReadyForNativeControls";
+
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+ MessagingCenter.Send(this, ReadyForNativeControlsMessage);
+ }
+
public NestedNativeControlGalleryPage ()
{
Layout = new StackLayout { Padding = 20, VerticalOptions = LayoutOptions.FillAndExpand };