views:

22

answers:

2

I have a situation where I want UIElement to have a top margin of

((this.height / 2) - 70) 

Currently, the XAML property is

Margin="0, 40, 0, 0"

How can I combine the equation above into my XAML? I know this is probably simple, but I can't figure out what terms to search for.

A: 

Use converter this purpose

just verify this link

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7b251696-4137-41f1-bc73-38ffa0081521

Kishore Kumar
Can you please elaborate? Thanks.
chris12892
just verify this link http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7b251696-4137-41f1-bc73-38ffa0081521
Kishore Kumar
+2  A: 

Have a look at ExpressionConverter from Josh Twist -

http://www.thejoyofcode.com/The_Binding_you_wanted_from_day_one_in_WPF.aspx

akjoshi
Thanks, that works!
chris12892
Happy to help :). It will be great if you can post your code. Will be helpful for others.
akjoshi