Created
May 30, 2016 15:40
-
-
Save AddressXception/028f5b7c9425eaae87fde5b17260f71c to your computer and use it in GitHub Desktop.
Demonstrates how to switch views on HoloLens. The AppviewSource comes from the Holographic DirectX 11 Application Template that ships with the HoloLens emulator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// https://msdn.microsoft.com/en-us/windows/uwp/layout/show-multiple-views | |
/// switch from this 2D XAML view to a IFrameworkView | |
/// </summary> | |
/// <param name="sender"></param> | |
/// <param name="e"></param> | |
private async void DirectX_OnClick(object sender, RoutedEventArgs e) | |
{ | |
var exclusiveViewApplicationSource = new AppViewSource(); | |
CoreApplicationView newView = CoreApplication.CreateNewView(exclusiveViewApplicationSource); | |
ApplicationView newAppView = null; | |
await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => | |
{ | |
newAppView = ApplicationView.GetForCurrentView(); | |
CoreWindow.GetForCurrentThread().Activate(); | |
}); | |
await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newAppView.Id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment