summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.Windows
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.ControlGallery.Windows')
-rw-r--r--Xamarin.Forms.ControlGallery.Windows/MainPage.xaml.cs14
1 files changed, 2 insertions, 12 deletions
diff --git a/Xamarin.Forms.ControlGallery.Windows/MainPage.xaml.cs b/Xamarin.Forms.ControlGallery.Windows/MainPage.xaml.cs
index d02dda0e..0446e394 100644
--- a/Xamarin.Forms.ControlGallery.Windows/MainPage.xaml.cs
+++ b/Xamarin.Forms.ControlGallery.Windows/MainPage.xaml.cs
@@ -17,18 +17,8 @@ namespace Xamarin.Forms.ControlGallery.Windows
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);
}