有关ResourceDictionary的快速问题。
在代码中,我曾经有这行代码
Application.Current.Resources.MergedWith = typeof(myResourceDictionary);
显然“ MergeWith”已过时!我们应该使用“来源”。
Application.Current.Resources.Source = new Uri("myResourceDictionary.xaml");
但是我在上面所做的工作不起作用。
我应该如何在代码中使用源代码?
谢谢
答案 0 :(得分:0)
如果您使用XAML,则可以这样设置:
<ContentPage.Resources>
<!-- Add more resources here -->
<ResourceDictionary Source="MyResourceDictionary.xaml" />
<!-- Add more resources here -->
</ContentPage.Resources>