You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WinUI3 Desktop开发:AppWindow中AccountLinkView页面无法显示

问题:AppWindow无法显示AccountLinkView内容

开发环境

  • Windows 11
  • VS2022
  • WinUI3 Desktop WindowsAppSDK 1.2.230
  • .Net Core 7

问题详情

基于MVPVM设计原则开发桌面应用时,根据文档要求,需将UWP中旧的Microsoft.UI.Xaml.Window替换为Microsoft.UI.Windowing.AppWindow。尝试为AppWindow添加页面导航及内容后,AccountLinkView始终无法显示。相关代码写在App.xaml.cs中(该文件其他功能正常),推测遗漏了关键步骤。

相关代码

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();
    }
}

内容的提问来源于stack exchange,提问作者Keyboard_Kowboy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.30 23:24:39