public MainWindow() { InitializeComponent(); CustomerViewModel obj = new CustomerViewModel(); obj.TxtCustomerName = "Nelson"; obj.TxtAmount = "2000"; //Level one -> glue on view (MVC approach); //Problems: too much code behind !!!! lblName.Content = obj.TxtCustomerName; lblAmount.Content = obj.TxtAmount; BrushConverter bc = new BrushConverter(); labelHabits.Background = bc.ConvertFromString(obj.LblAmountColor) as SolidColorBrush; chkMarried.IsChecked = obj.IsMarried; }
//Heavely Couple public ButtonCommand(CustomerViewModel _obj) { obj = _obj; }
public ButtonCommand(CustomerViewModel _obj) //Heavely Couple { obj = _obj; }