【发布时间】:2019-10-14 04:46:33
【问题描述】:
我正在尝试全局更改字体大小。为此,我在 app.xaml 中添加了样式。这里我的FontSz 属性在 MainWindowViewModel 中。有没有办法使这种绑定成为可能?
<Application.Resources>
<Style TargetType="{x:Type Control}" x:Key="baseStyle">
<Setter Property="FontSize" Value="{Binding Path=???.FontSz}" />
</Style>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource baseStyle}"/>
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource baseStyle}"/>
</Application.Resources>
【问题讨论】:
-
您是否尝试在运行时由用户更改字体大小?
-
@Insane 是的。它由用户设置。
标签: wpf data-binding