public void DataContextChangedHandler(global::Windows.UI.Xaml.FrameworkElement sender, global::Windows.UI.Xaml.DataContextChangedEventArgs args) { global::App1.Models.Item data = args.NewValue as global::App1.Models.Item; if (args.NewValue != null && data == null) { throw new global::System.ArgumentException("Incorrect type passed into template. Based on the x:DataType global::App1.Models.Item was expected."); } this.SetDataRoot(data); this.Update(); }
public void PropertyChanged_(object sender, global::System.ComponentModel.PropertyChangedEventArgs e) { MainPage_obj21_Bindings bindings; if (WeakRefToBindingObj.TryGetTarget(out bindings)) { string propName = e.PropertyName; global::App1.Models.Item obj = sender as global::App1.Models.Item; if (global::System.String.IsNullOrEmpty(propName)) { if (obj != null) { 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 "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; } } } }
// Update methods for each path node used in binding steps. private void Update_(global::App1.Models.Item obj, int phase) { this.bindingsTracking.UpdateChildListeners_(obj); if (obj != null) { if ((phase & (NOT_PHASED | DATA_CHANGED | (1 << 0))) != 0) { 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.Item obj) { MainPage_obj21_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_; } } }
// MainPage_obj21_Bindings public void SetDataRoot(global::App1.Models.Item newDataRoot) { this.bindingsTracking.ReleaseAllListeners(); this.dataRoot = newDataRoot; }