/// <summary> /// Visually replaces the current view with this view. /// </summary> /// <param name="fromView"> /// The view you are switching from. /// </param> /// <param name="options"> /// Options for the display transition behaviors. /// </param> /// <returns> /// A <see cref="Task"/> that represents the operation. /// </returns> public async Task SwitchAsync(AppViewInfo fromView, ApplicationViewSwitchingOptions options) { // From view MUST be passed if (fromView == null) { throw new ArgumentNullException(nameof(fromView)); } await dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { await ApplicationViewSwitcher.SwitchAsync(this.view.Id, fromView.view.Id, options); }); }
/// <summary> /// Visually replaces the current view with this view. /// </summary> /// <param name="fromView"> /// The view you are switching from. /// </param> /// <param name="options"> /// Options for the display transition behaviors. /// </param> /// <returns> /// A <see cref="Task"/> that represents the operation. /// </returns> public async Task SwitchAndConsolidateAsync(AppViewInfo fromView, ApplicationViewSwitchingOptions options) { // From view MUST be passed if (fromView == null) { throw new ArgumentNullException(nameof(fromView)); } await dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { ApplicationViewSwitcher.DisableShowingMainViewOnActivation(); await ApplicationViewSwitcher.SwitchAsync(this.view.Id, fromView.view.Id, options); await this.view.TryConsolidateAsync(); }); }
/// <summary> /// Visually replaces the current view with this view. /// </summary> /// <remarks> /// When possible use <see cref="SwitchAsync"/> instead of this method. /// <see cref="SwitchAsync"/> will not be visible to Unity behaviors /// when in the editor. The async versions require UWP. /// </remarks> public void Switch(AppViewInfo fromView, ApplicationViewSwitchingOptions options) { SwitchAsync(fromView, options).Wait(); }