Access dependency property from a viewmodel WPF
HI, i'm using WPF and MVVM pattern. i've created a DependencyProperty
IsEditable
and how do i access this one from my viewmodel to bind it to CanExecute for my command.
2 Replies
Dependency props are part of the view and shouldn't touch the viewmodel
Bind the dependency property to the control that invokes the command, use it as a toggle for the control's IsEnabled, visibility or whatever.
Alternatively, pass the dependency property as the command parameter
Bind to the dependency property via template binding
ohhhh true i've understand i bind IsEditable to isEnabled in the control for exemple :