private async void Button_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { var parameters = new NotePageParams(); parameters.Note = (e.OriginalSource as FrameworkElement).DataContext as Note; await OpenPageAsWindowAsync(typeof(NotePage), parameters); }
/// <summary> /// Opens a page given the page type as a new window. /// </summary> /// <param name="t"></param> /// <returns></returns> private async Task <bool> OpenPageAsWindowAsync(Type t, NotePageParams notePageParams) { var view = CoreApplication.CreateNewView(); int id = 0; await view.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { var frame = new Frame(); frame.Navigate(t, notePageParams); Window.Current.Content = frame; Window.Current.Activate(); id = ApplicationView.GetForCurrentView().Id; }); return(await ApplicationViewSwitcher.TryShowAsStandaloneAsync(id)); }