Windows 11 VS2022 WinUI3 Desktop WindowsAppSDK 1.2.230 .Net core 7
I'm creating a desktop app using MVPVM design principles. The documentation says that Microsoft.UI.Xaml.Window used within a UWP is not longer available, and is switching to Microsoft.UI.Windowsing.AppWindow.
I'm trying to add some page navigation and page content to the AppWindow. The AccountLinkView never displays. This is within the App.xaml.cs (which works fine) but I feel like I'm missing something.
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
new MainWindow().Activate();
if (e != null)
{
AppWindow rootWindow = WindowPresenter.Window;
if (rootWindow == null)
{
WindowPresenter.Initialize();
WindowPresenter.Navigate(typeof(AccountLinkView));
}
WindowPresenter.Show();
}
}