Hi,
your property Test need to be
A) a DP defined like this :
B) MainWindow should be INotifyPropertyChanged like this :
your property Test need to be
A) a DP defined like this :
public static readonly DependencyProperty TestProperty =
DependencyProperty.Register( "Test",
typeof( Color ),
typeof( MainWindow ),
new FrameworkPropertyMetadata( null ) );
public Color Test
{
get
{
return ( Color )this.GetValue( MainWindow.TestProperty );
}
set
{
this.SetValue( MainWindow.TestProperty, value );
}
}
or B) MainWindow should be INotifyPropertyChanged like this :
public partial class MainWindow : Window, INotifyPropertyChanged
{
public Color Test
{
get
{
return m_test;
}
set
{
m_test = value;
OnPropertyChanged( "Test" );
}
}
private Color m_test;
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged( string propertyName )
{
if( PropertyChanged != null )
{
PropertyChanged( this, new PropertyChangedEventArgs( propertyName ) );
}
}
}