tags:

views:

37

answers:

2

so, i've found a way to bind a label to a property on current Control

i give it a name:

<UserControl x:Class="WpfGridtest.GridControl" x:Name="GridControlControl1">

and than bind to property of this control:

<Label Content="{Binding ElementName=GridControlControl1, Path=Filter}"></Label>

I can see the default value i put in that property.

I am guessing that this isn't working because i am binding to String property which doesn't implement INotifyPropertyChanged??

is there some other type i should be using for this property instead of String auto notify my label of changes, or am i going about this the wrong way?

+1  A: 

The INotifyPropertyChanged interface should be implemented by the class that contains the property - in this case, by your WpfGridtest.GridControl.

Also, if you want to use your properties for UI, consider using a DependencyProperty as a storage instead of a private field.

Fyodor Soikin
A: 

in addition, it is also likely that the default binding mode is one time, so you may have to change it in your {Binding}

Muad'Dib
i tried adding Mode=OneWay but no changes.
Sonic Soul
also tried adding NotifyOnSourceUpdated=True, but also no changes
Sonic Soul