Нужно переменную разделить на два. Пример:
TextBlock.FontSize="{Binding ElementName=buttonControl1, Path=Height/2}"
Upd: Так не получается:
<UserControl.Resources>
<!--Конвертер-->
<local:FontSizeConverter x:Key="fontSizeConverter"/>
</UserControl.Resources>
<StackPanel>
<Button Name="buttonControl1" Content="Push!" Template = "{StaticResource buttonTemplate}" Height="100" FontSize="{Binding ElementName=buttonControl1, Path=Height, Converter={StaticResource fontSizeConverter}}"/>
</StackPanel>
_
public class FontSizeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (double)value / 2;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return (double)value * 2;
}
}
Ругается в XAML на биндинд FontSize'a "object reference not set to an instance of an object"