public void DataContextChangedHandler(global::Windows.UI.Xaml.FrameworkElement sender, global::Windows.UI.Xaml.DataContextChangedEventArgs args) { global::G_Store.Models.TodoItem data = args.NewValue as global::G_Store.Models.TodoItem; if (args.NewValue != null && data == null) { throw new global::System.ArgumentException("Incorrect type passed into template. Based on the x:DataType global::G_Store.Models.TodoItem was expected."); } this.SetDataRoot(data); this.Update(); }
// Update methods for each path node used in binding steps. private void Update_(global::G_Store.Models.TodoItem obj, int phase) { this.bindingsTracking.UpdateChildListeners_(obj); if (obj != null) { if ((phase & (NOT_PHASED | DATA_CHANGED | (1 << 0))) != 0) { this.Update_completed(obj.completed, phase); this.Update_img(obj.img, phase); } if ((phase & (NOT_PHASED | (1 << 0))) != 0) { this.Update_title(obj.title, phase); } } }
public void UpdateChildListeners_(global::G_Store.Models.TodoItem obj) { NotePage_obj19_Bindings bindings; if (WeakRefToBindingObj.TryGetTarget(out bindings)) { if (bindings.dataRoot != null) { ((global::System.ComponentModel.INotifyPropertyChanged)bindings.dataRoot).PropertyChanged -= PropertyChanged_; } if (obj != null) { bindings.dataRoot = obj; ((global::System.ComponentModel.INotifyPropertyChanged)obj).PropertyChanged += PropertyChanged_; } } }
public void PropertyChanged_(object sender, global::System.ComponentModel.PropertyChangedEventArgs e) { NotePage_obj19_Bindings bindings; if (WeakRefToBindingObj.TryGetTarget(out bindings)) { string propName = e.PropertyName; global::G_Store.Models.TodoItem obj = sender as global::G_Store.Models.TodoItem; if (global::System.String.IsNullOrEmpty(propName)) { if (obj != null) { bindings.Update_completed(obj.completed, DATA_CHANGED); bindings.Update_img(obj.img, DATA_CHANGED); } } else { switch (propName) { case "completed": { if (obj != null) { bindings.Update_completed(obj.completed, DATA_CHANGED); } break; } case "img": { if (obj != null) { bindings.Update_img(obj.img, DATA_CHANGED); } break; } default: break; } } } }
// NotePage_obj19_Bindings public void SetDataRoot(global::G_Store.Models.TodoItem newDataRoot) { this.bindingsTracking.ReleaseAllListeners(); this.dataRoot = newDataRoot; }