private void MainPgaeNavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) { if (args.IsSettingsInvoked) { MainPageRootFrame.Navigate(typeof(SettingsPage)); } else { switch (args.InvokedItem as string) { case "主页": MainPageRootFrame.Navigate(typeof(HomePage)); break; case "天气": MainPageRootFrame.Navigate(typeof(WeatherPage)); break; case "房间": MainPageRootFrame.Navigate(typeof(RoomPage)); break; case "来访": MainPageRootFrame.Navigate(typeof(FaceDetectPage)); break; default: break; } } }
public MainPage() { this.InitializeComponent(); MainPageRootFrame.Navigate(typeof(HomePage)); MyHome = Home.LoadHome().Result; }