I am doing a WPF project and trying to stick with the MVVM pattern. It has about 20 UserControls, each of which contains about 10 controls. I want to be able to change properties. For each of them I need to change Visibilityand IsEnabled(properties of the Framework element), and then change the content and text. These are at least 3 properties for each control. In all UserControls, which is 600 properties ...
I played with the idea of ββcreating a class ControlProperties, and each control was bound to the correct instance member variable. (For instance)
public class ControlProperties
{
private bool m_isEnabled;
public property IsEnabled
{
get { return m_isEnabled; }
set { m_isEnabled = value; notifyPropertyChanged("IsEnabled"); }
}
ControlProperties() { m_isEnabled = false; }
}
public ControlProperties controlOne;
<Button IsEnabled={Binding controlOne.IsEnabled}/>
2+ - / , ? ( "", ). , . ... .
, , - -.