C# 如何在设计时为xaml选择默认资源字典?

C# 如何在设计时为xaml选择默认资源字典?,c#,wpf,C#,Wpf,我的应用程序有两个主题(黑暗、光明),我为此创建了两个资源字典文件 例如: 1) 主题/黑暗 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <SolidColorBrush x:Key="xxx" Color="#fff

我的应用程序有两个主题(黑暗、光明),我为此创建了两个资源字典文件

例如:

1) 主题/黑暗

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <SolidColorBrush x:Key="xxx" Color="#ffffffff" />
    <SolidColorBrush x:Key="xxx1" Color="#ff000000" />
</ResourceDictionary>
但在Designer中的设计时,未选择我的资源字典,我有以下问题(屏幕):

如何为设计时选择资源字典

将此代码添加到csproj文件不适用于我

<ContainsDesignTimeResources>true</ContainsDesignTimeResources> 
...Condition="'$(DesignTime)'=='true' OR ('$(SolutionPath)'!='' AND... 
true
…条件=“$(设计时间)”==“真”或(“$(解决方案路径)”和。。。
var rootResources = Application.Current.Resources;
var resDict = new ResourceDictionary () {
    Source = new Uri (path, UriKind.RelativeOrAbsolute)
};
rootResources.MergedDictionaries.Add (resDict);
<ContainsDesignTimeResources>true</ContainsDesignTimeResources> 
...Condition="'$(DesignTime)'=='true' OR ('$(SolutionPath)'!='' AND...