Hello,
I'm trying to bind a Dependency Property from my UserControl to my MainViewModel.
This is how the DependencyProperty looks like:
public static DependencyProperty ItemHasChangesProperty = DependencyProperty.Register("ItemHasChanges",
typeof(bool),
typeof(MyUserControl),
new PropertyMetadata(null));
public bool ItemHasChanges
{
get { return (bool)GetValue(ItemHasChangesProperty); }
set { SetValue(ItemHasChangesProperty, value); }
}
My XAML:
<local:MyUserControl ItemHasChanges="{Binding Path=Changes}" Grid.Row="4" />
Now when debugging and checking the Set-Accessor of "bool Changes", I see that it never gets accessed when I set in the UserControl ItemHasChanges = true;
Any idea what I'm doing wrong here?
Thanks!
Cheers