コード例 #1
0
        private async void CreateView_Click(object sender, RoutedEventArgs e)
        {
            ViewLifeTimeControl viewControl = null;
            await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                viewControl       = ViewLifeTimeControl.CreateForCurrentView();
                viewControl.Title = DEFAULT_TITLE;
                viewControl.StartViewInUse();
                Frame frame = new Frame();
                frame.Navigate(typeof(SecondaryViewPage), viewControl);
                Window.Current.Content = frame;
                Window.Current.Activate();
                ApplicationView.GetForCurrentView().Title = viewControl.Title;
            });

            ((App)App.Current).SecondaryViews.Add(viewControl);
        }