in

DĂ© specialist in .NET trainingen en consultancy

Jo-wen Mei

Arithmetic operations in xaml

Many times, you want to bind a numeric value to another property AND perform some calculation over it.

For instance, you would like to bind the width of your control to be half the size of its parent control.

Take a look at this converter

 

It enables a xaml syntax like this:

{Binding ElementName=control, Path=ActualWidth, Converter={StaticResource arithConverter}, ConverterParameter=*0.5}

 

Published nov 11 2009, 08:53 by Jo-wen
Filed under: ,

Comments

No Comments