Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find a Resource with the Name/Key X

I changed styles of some controls using Blend and it auto generated some styles. But for some random users this error occurs:

Cannot find a Resource with the Name/Key PivotPreviousButtonBorderBrush [Line: 0 Position: 0]

Key sometimes is ListViewItemBackground etc.

Why are these default resources missing in some devices? how to prevent it? Thanks.

like image 973
Blendester Avatar asked Nov 07 '22 18:11

Blendester


1 Answers

If you're using Microsoft.UI.Xaml.Controls library - you should add reference to app.xaml:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>
like image 130
Vladislav Horbachov Avatar answered Nov 15 '22 13:11

Vladislav Horbachov