I am trying to associate the Dependency property from my UserControl with my MainViewModel.
This is what 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 that I have debugged and checked the Set-Accessor "bool Changes", I see that it never gets access when I set in UserControl ItemHasChanges = true;
Any idea what I'm doing wrong here?
Thanks!
Greetings
source share