问题
After installing WinUI into UWP application.I am getting 'Cannot find a Resource with the Name/Key TopCornerRadiusFilterConverter' error
Sample code:
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
controls:DropDownButton Content="test"></controls:DropDownButton>
Application version:
回答1:
Cannot find a Resource with the Name/Key TopCornerRadiusFilterConverter in uwp
After install the WinUI nuget package, it will display note window said:
Thanks for installing the WinUI NuGet package!
Don't forget to set XamlControlsResources as your Application resources in App.xaml:
<Application>
<Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</Application.Resources>
</Application>
or if you have other resources then add XamlControlsResources at the top as a merged dictionary:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
See http://aka.ms/winui for more information.
So, Please add <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
into your app's application resource.
来源:https://stackoverflow.com/questions/59243777/cannot-find-a-resource-with-the-name-key-topcornerradiusfilterconverter-in-uwp