OK chaps, I did have to use a dependency property, and I had to get the Binding 
XAML correct. I have this code and XAML

 

public static readonly DependencyProperty IsDirtyProperty = 
DependencyProperty.Register("IsDirty", typeof(bool), typeof(SettingsWindow));

public bool IsDirty
{
    get { return (bool)GetValue(IsDirtyProperty); }
    set { SetValue(IsDirtyProperty, value); }
}

 

<Button x:Name="btnSettingsOK" IsEnabled="{Binding 
ElementName=WinSettings,Path=IsDirty}" ... />

-or-

<Button x:Name=" btnSettingsOK " IsEnabled="{Binding IsDirty, 
ElementName=WinSettings}" ... />

 

Both Binding statements work. I can’t decide which feels more natural. There is 
no need to implement INotifyPropertyChanged as no one is listening to this 
modal dialog window.

 

I printed off a WPF Binding Cheat Sheet 
<http://www.nbdtech.com/Free/WpfBinding.pdf> .

 

Greg

_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to