--- lang: ja-jp breaks: true --- # UWP 別スレッドのウインドウを表示 2021-04-13 > ApplicationView を使用して複数のビューを表示する > https://docs.microsoft.com/ja-jp/windows/uwp/design/layout/application-view ### 環境 * Microsoft Visual Studio Professional 2019 Preview(Version 16.10.0 Preview 1.0) * Windows Server 2019 1809 * Microsoft.NETCore.UniversalWindowsPlatform 6.2.12 ### 新しいページの作成 「新しい項目の追加」より、「空白のページ」を選択し、名前を付けて保存します。 ![](https://i.imgur.com/b6oryxH.png) ### 別スレッドのウインドウを表示する処理を記述 ```csharp= private async void Button_Click_1(object sender, RoutedEventArgs e) { Debug.WriteLine("ManagedThreadId:" + Thread.CurrentThread.ManagedThreadId); CoreApplicationView newView = CoreApplication.CreateNewView(); int newViewId = 0; await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Frame frame = new Frame(); frame.Navigate(typeof(SecondaryPage), null); Window.Current.Content = frame; // You have to activate the window in order to show it later. Window.Current.Activate(); newViewId = ApplicationView.GetForCurrentView().Id; }); bool viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newViewId); } ``` ![](https://i.imgur.com/4mRuRCT.png) ###### tags: `UWP`