public void UpdateChildListeners_ViewModel(global::DeskPowerApp.ViewModels.EditorViewModel 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; } } }
private void Update_ViewModel(global::DeskPowerApp.ViewModels.EditorViewModel obj, int phase) { this.bindingsTracking.UpdateChildListeners_ViewModel(obj); if (obj != null) { if ((phase & (NOT_PHASED | DATA_CHANGED | (1 << 0))) != 0) { this.Update_ViewModel_CategoryList(obj.CategoryList, phase); this.Update_ViewModel_Saved(obj.Saved, phase); } if ((phase & (NOT_PHASED | (1 << 0))) != 0) { this.Update_ViewModel_Drafts(obj.Drafts, phase); } } }
public void PropertyChanged_ViewModel(object sender, global::System.ComponentModel.PropertyChangedEventArgs e) { Editor_obj1_Bindings bindings; if (WeakRefToBindingObj.TryGetTarget(out bindings)) { string propName = e.PropertyName; global::DeskPowerApp.ViewModels.EditorViewModel obj = sender as global::DeskPowerApp.ViewModels.EditorViewModel; if (global::System.String.IsNullOrEmpty(propName)) { if (obj != null) { bindings.Update_ViewModel_CategoryList(obj.CategoryList, DATA_CHANGED); bindings.Update_ViewModel_Saved(obj.Saved, DATA_CHANGED); } } else { switch (propName) { case "CategoryList": { if (obj != null) { bindings.Update_ViewModel_CategoryList(obj.CategoryList, DATA_CHANGED); } break; } case "Saved": { if (obj != null) { bindings.Update_ViewModel_Saved(obj.Saved, DATA_CHANGED); } break; } default: break; } } } }