Is there a way to do simple calculations in a xaml element binding statement other than using a conv
- by Jonathan Websdale
In XAML I want to bind the height of one element to be half the height of another element.
Is there a way to do this that doesn't involve writing a converter in the code-behind?
Example:-
What I've got...
<Button Name="RemoveButton" Content="Remove Stage" Width="100" Height="{Binding ElementName=AddButton, Path=Height, Converter={StaticResource MyHalfHeightConverter}}"/>
What I'd like...
<Button Name="RemoveButton" Content="Remove Stage" Width="100" Height="{Binding ElementName=AddButton, Path=(Height / 2.0)}"/>