【问题标题】:WIN UI 3 and UWP life cycleWINUI 3 和 UWP 生命周期
【发布时间】:2022-01-04 09:41:15
【问题描述】:

我在WIN-UI-3 中创建了一个应用程序,我正在尝试在win-ui-3 中获取UWP 生命周期hooks/events。尽管如此,我在其中找不到任何生命周期hooks/events

这是我的.csprod 文件的样子:

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>App3</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>
</PropertyGroup>



<!-- Workaround for https://github.com/dotnet/sdk/issues/17890 -->
<PropertyGroup>
<NoWarn>CA1416, $(NoWarn)</NoWarn>
</PropertyGroup>



<ItemGroup>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>



<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.0" />
</ItemGroup>
</Project>

我实际上正在尝试创建一个活动监控应用程序,比如 hubstuff,但我不知道我是否走在正确的道路上。

【问题讨论】:

  • 您能否澄清一下您正在寻找哪些钩子/事件,有什么例子吗? (也是从 Reunion 0.8 升级到 WindowsAppSdk 1.0 的时候了)

标签: c# .net uwp winui-3


【解决方案1】:

您在项目文件中定位的 WinUI 3 稳定生产就绪版本不支持 UWP 应用模型:

<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.0" />

如果你安装1.0.0-experimental1版本,有一个[Experimental] Blank App (WinUI 3 in UWP)项目模板可以用来创建基于WinUI3库的UWP应用。

请注意,实验版本不支持在生产环境中使用,使用实验版本的应用无法发布到 Microsoft Store。实验性功能也可能会从下一个版本中删除,或者可能永远不会发布。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-03
    • 2018-07-18
    • 2012-09-21
    • 2019-01-05
    • 2015-09-10
    相关资源
    最近更新 更多