Mega Code Archive

 
Categories / C# / WPF
 

Binding FontFamily FontSize value for current Control

<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"             TextBlock.FontSize="12" >     <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">         <TextBlock Text="This TextBlock has a FontFamily of " />         <TextBlock Text="{Binding RelativeSource={RelativeSource self},Path=FontFamily}" />         <TextBlock Text=" and a FontSize of " />         <TextBlock Text="{Binding RelativeSource={RelativeSource self},Path=FontSize}" />     </StackPanel> </StackPanel>