Cannot find a Resource with the Name/Key X

Viewed 1557

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.

2 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>
Related