我正在尝试使用某些特定样式设置我的 UWP 应用程序的样式,而在其他平台上它应该保持默认设置。
这是我的项目布局:
我尝试了以下事情:在Clients.Shared
创建如下样式时:
<Style x:Key="SomeStyle" TargetType="Button" />
并在其中添加相同的 Style 键,Clients.Themes.UWP
因此它有望覆盖它,但没有运气。
然后我尝试了使用虚拟风格并使用,onPlatform
但这也不起作用,但我仍然认为这是要走的路。我有以下代码:
<Style x:Key="DummyStyle" TargetType="Button">
<Setter Property="Style">
<Setter.Value>
<OnPlatform x:Key="ButtonStyle" x:TypeArguments="Style">
<On Platform="UWP" Value="{StaticResource SomeStyle}"></On>
</OnPlatform>
</Setter.Value>
</Setter>
</Style>
我尝试搞乱合并ResourceDictionary.MergedDictionaries
,但我无法包含 xaml
有人有任何线索吗?