Beispiel #1
0
                public void PropertyChanged_viewModel(object sender, global::System.ComponentModel.PropertyChangedEventArgs e)
                {
                    MainWindow_obj1_Bindings bindings = TryGetBindingObject();

                    if (bindings != null)
                    {
                        string propName = e.PropertyName;
                        global::EmployeeManager.ViewModel.MainViewModel obj = sender as global::EmployeeManager.ViewModel.MainViewModel;
                        if (global::System.String.IsNullOrEmpty(propName))
                        {
                            if (obj != null)
                            {
                                bindings.Update_viewModel_isEmployeSelected(obj.isEmployeSelected, DATA_CHANGED);
                                bindings.Update_viewModel_SelectedEmployee(obj.SelectedEmployee, DATA_CHANGED);
                                bindings.Update_viewModel_Employees(obj.Employees, DATA_CHANGED);
                            }
                        }
                        else
                        {
                            switch (propName)
                            {
                            case "isEmployeSelected":
                            {
                                if (obj != null)
                                {
                                    bindings.Update_viewModel_isEmployeSelected(obj.isEmployeSelected, DATA_CHANGED);
                                }
                                break;
                            }

                            case "SelectedEmployee":
                            {
                                if (obj != null)
                                {
                                    bindings.Update_viewModel_SelectedEmployee(obj.SelectedEmployee, DATA_CHANGED);
                                }
                                break;
                            }

                            case "Employees":
                            {
                                if (obj != null)
                                {
                                    bindings.Update_viewModel_Employees(obj.Employees, DATA_CHANGED);
                                }
                                break;
                            }

                            default:
                                break;
                            }
                        }
                    }
                }
Beispiel #2
0
 public void UpdateChildListeners_viewModel(global::EmployeeManager.ViewModel.MainViewModel obj)
 {
     if (obj != cache_viewModel)
     {
         if (cache_viewModel != null)
         {
             ((global::System.ComponentModel.INotifyPropertyChanged)cache_viewModel).PropertyChanged -= PropertyChanged_viewModel;
             cache_viewModel = null;
         }
         if (obj != null)
         {
             cache_viewModel = obj;
             ((global::System.ComponentModel.INotifyPropertyChanged)obj).PropertyChanged += PropertyChanged_viewModel;
         }
     }
 }
Beispiel #3
0
 private void Update_viewModel(global::EmployeeManager.ViewModel.MainViewModel obj, int phase)
 {
     this.bindingsTracking.UpdateChildListeners_viewModel(obj);
     if (obj != null)
     {
         if ((phase & (NOT_PHASED | DATA_CHANGED | (1 << 0))) != 0)
         {
             this.Update_viewModel_isEmployeSelected(obj.isEmployeSelected, phase);
             this.Update_viewModel_SelectedEmployee(obj.SelectedEmployee, phase);
         }
         if ((phase & (NOT_PHASED | (1 << 0))) != 0)
         {
             this.Update_viewModel_JobRoles(obj.JobRoles, phase);
         }
         if ((phase & (NOT_PHASED | DATA_CHANGED | (1 << 0))) != 0)
         {
             this.Update_viewModel_Employees(obj.Employees, phase);
         }
     }
 }