我正在尝试对我的UWP应用程序使用新的WinUI工具包TreeView / TeachingTip / ...控件。我已经从Nudget包中添加了对Microsoft.UI.Xaml的引用。
<Page
x:Class="UWPInVS2019.Login"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UWPInVS2019"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:WinCon="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d"
>
<Grid>
<Button />
<WinCon:TeachingTip/>
</Grid>
问题是您错过了将XamlControlsResources
添加到UWP项目的App.xaml文件中。请将以下xaml代码添加到App.xaml文件中。
<Application>
<Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</Application.Resources>
</Application>
更多详细信息,请参考WinUI official教程。