summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.WP8/MainPage.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.ControlGallery.WP8/MainPage.xaml.cs')
-rw-r--r--Xamarin.Forms.ControlGallery.WP8/MainPage.xaml.cs14
1 files changed, 2 insertions, 12 deletions
diff --git a/Xamarin.Forms.ControlGallery.WP8/MainPage.xaml.cs b/Xamarin.Forms.ControlGallery.WP8/MainPage.xaml.cs
index e1ddb60f..a2b24287 100644
--- a/Xamarin.Forms.ControlGallery.WP8/MainPage.xaml.cs
+++ b/Xamarin.Forms.ControlGallery.WP8/MainPage.xaml.cs
@@ -61,18 +61,8 @@ namespace Xamarin.Forms.ControlGallery.WP8
var app = new Controls.App ();
- var mdp = app.MainPage as MasterDetailPage;
-
- var detail = mdp?.Detail as NavigationPage;
- if (detail != null) {
- detail.Pushed += (sender, args) => {
- var nncgPage = args.Page as NestedNativeControlGalleryPage;
-
- if (nncgPage != null) {
- AddNativeControls (nncgPage);
- }
- };
- }
+ // When the native control gallery loads up, it'll let us know so we can add the nested native controls
+ MessagingCenter.Subscribe<NestedNativeControlGalleryPage>(this, NestedNativeControlGalleryPage.ReadyForNativeControlsMessage, AddNativeControls);
LoadApplication (app);
}