Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I add/subtract value that is bound to an element property?

Tags:

wpf

xaml

Does XAML allows modification of bound value?
Like Width="{Binding Elementname="lstMine", Path=Width}" -100 ? So that I can have a relative value.

like image 869
sarath Avatar asked Aug 26 '10 06:08

sarath


2 Answers

You can use converters for this purpose, and my WPF Converters library includes an ExpressionConverter that allows you to do exactly that:

Width="{Binding Width, ElementName=lstMine, Converter={con:ExpressionConverter {}{0}-100}}"
like image 110
Kent Boogaart Avatar answered Oct 30 '22 03:10

Kent Boogaart


use Converter for these purpose

like image 25
Kishore Kumar Avatar answered Oct 30 '22 02:10

Kishore Kumar