public partial class App : Application { public double FontSize => 30.0; }
<Button x:Name="BtnSettings" Width="90" Height="30" Margin="200,14,0,0" Padding="6,3" HorizontalAlignment="Left" VerticalAlignment="Top" UseLayoutRounding="True" SnapsToDevicePixels="True" FontSize="10"> <Button.Content > <Viewbox x:Name="myViewbox" SnapsToDevicePixels="True" Stretch="Uniform" StretchDirection="Both"> <TextBlock x:Name="myTextbox" Margin="0,-2,0,0" FontFamily="Segoe UI"> <TextBlock.FontSize> <MultiBinding> <MultiBinding.Converter> <local:AverageConverter/> </MultiBinding.Converter> <Binding Source="{x:Static Application.Current}" Path="FontSize" Mode="OneWay"/> <Binding Path="FontSize" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}"/> </MultiBinding> </TextBlock.FontSize> FontSize = <Run Text="{Binding FontSize, Mode=OneWay, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TextBlock}}}" FontWeight="Bold"/>; </TextBlock> </Viewbox> </Button.Content> </Button>