首页 > 解决方案 > Xamarin Forms Prism:prism ResourceDictionary 中已存在具有键“Xamarin.Forms.NavigationPage”的资源

问题描述

我有一个使用 Prism 8 的 Xamarin Forms 5.0 应用程序。当我将以下内容添加到 ResourceDictionary 中时:

<Style TargetType="{x:Type NavigationPage}">
    <Setter Property="BackgroundColor" Value="{StaticResource PrimaryBackground}" />
    <Setter Property="BarBackgroundColor" Value="#ea5c2d" />
</Style>

我收到异常“ResourceDictionary 中已存在具有键‘Xamarin.Forms.NavigationPage’的资源”

我没有在任何地方创建重复标签,所以不知道为什么。

感激地收到任何帮助。

标签: androidxamarin.formsprismresourcedictionary

解决方案


有同样的问题。

查看您的“App.xaml”。

在我的情况下,有一个重复。


推荐阅读