public void DataContextChangedHandler(global::Windows.UI.Xaml.FrameworkElement sender, global::Windows.UI.Xaml.DataContextChangedEventArgs args) { global::App1.Models.ListItem data = args.NewValue as global::App1.Models.ListItem; if (args.NewValue != null && data == null) { throw new global::System.ArgumentException("Incorrect type passed into template. Based on the x:DataType global::App1.Models.ListItem was expected."); } this.SetDataRoot(data); this.Update(); }
// Update methods for each path node used in binding steps. private void Update_(global::App1.Models.ListItem obj, int phase) { this.bindingsTracking.UpdateChildListeners_(obj); if (obj != null) { if ((phase & (NOT_PHASED | DATA_CHANGED | (1 << 0))) != 0) { this.Update_Complete(obj.Complete, phase); this.Update_Image(obj.Image, phase); this.Update_Title(obj.Title, phase); this.Update_Line_Visibility(obj.Line_Visibility, phase); } } }
public void UpdateChildListeners_(global::App1.Models.ListItem obj) { MainPage_obj23_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) { MainPage_obj23_Bindings bindings; if (WeakRefToBindingObj.TryGetTarget(out bindings)) { string propName = e.PropertyName; global::App1.Models.ListItem obj = sender as global::App1.Models.ListItem; if (global::System.String.IsNullOrEmpty(propName)) { if (obj != null) { bindings.Update_Complete(obj.Complete, DATA_CHANGED); bindings.Update_Image(obj.Image, DATA_CHANGED); bindings.Update_Title(obj.Title, DATA_CHANGED); bindings.Update_Line_Visibility(obj.Line_Visibility, DATA_CHANGED); } } else { switch (propName) { case "Complete": { if (obj != null) { bindings.Update_Complete(obj.Complete, DATA_CHANGED); } break; } case "Image": { if (obj != null) { bindings.Update_Image(obj.Image, DATA_CHANGED); } break; } case "Title": { if (obj != null) { bindings.Update_Title(obj.Title, DATA_CHANGED); } break; } case "Line_Visibility": { if (obj != null) { bindings.Update_Line_Visibility(obj.Line_Visibility, DATA_CHANGED); } break; } default: break; } } } }
// MainPage_obj23_Bindings public void SetDataRoot(global::App1.Models.ListItem newDataRoot) { this.bindingsTracking.ReleaseAllListeners(); this.dataRoot = newDataRoot; }