如何为我的短剧创作一种全球风格?我有这段代码,但是当我运行它时,它会产生一个错误。谢谢!
SomeWindows.xaml
<mahApps:MetroWindow.Flyouts>
<mahApps:FlyoutsControl>
<mahApps:Flyout Style="{StaticResource GlobalStatusFlyoutStyle}"/>
</mahApps:FlyoutsControl>
</mahApps:MetroWindow.Flyouts>App.xaml
<Style x:Key="GlobalStatusFlyoutStyle"
TargetType="{x:Type mahApps:Flyout}">
<Setter Property="Template"
Value="{StaticResource GlobalStatusFlyout}" />
</Style>
<ControlTemplate x:Key="GlobalStatusFlyout"
TargetType="{x:Type mahApps:Flyout}">
<DockPanel>
//BLA BLA BLA
</DockPanel>
</ControlTemplate>发布于 2017-03-13 15:06:40
更改ControlTemplate和Style的声明顺序。如果ControlTemplate是在它之后声明的,则样式无法访问它。秩序是XAML的问题。
而且你的ControlTemplate的身体也可能有错误。
https://stackoverflow.com/questions/42766125
复制相似问题