public void DataContextChangedHandler(global::Windows.UI.Xaml.FrameworkElement sender, global::Windows.UI.Xaml.DataContextChangedEventArgs args) { global::RecipeRate.ViewModels.RecipeRatingViewModel data = args.NewValue as global::RecipeRate.ViewModels.RecipeRatingViewModel; if (args.NewValue != null && data == null) { throw new global::System.ArgumentException("Incorrect type passed into template. Based on the x:DataType global::RecipeRate.ViewModels.RecipeRatingViewModel was expected."); } this.SetDataRoot(data); this.Update(); }
// Update methods for each path node used in binding steps. private void Update_(global::RecipeRate.ViewModels.RecipeRatingViewModel obj, int phase) { this.bindingsTracking.UpdateChildListeners_(obj); if (obj != null) { if ((phase & (NOT_PHASED | DATA_CHANGED | (1 << 0))) != 0) { this.Update_RecipeName(obj.RecipeName, phase); this.Update_DateUpdated(obj.DateUpdated, phase); this.Update_Rating(obj.Rating, phase); this.Update_BadgeSource(obj.BadgeSource, phase); } } }
public void UpdateChildListeners_(global::RecipeRate.ViewModels.RecipeRatingViewModel obj) { MainPage_obj2_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_obj2_Bindings bindings; if (WeakRefToBindingObj.TryGetTarget(out bindings)) { string propName = e.PropertyName; global::RecipeRate.ViewModels.RecipeRatingViewModel obj = sender as global::RecipeRate.ViewModels.RecipeRatingViewModel; if (global::System.String.IsNullOrEmpty(propName)) { if (obj != null) { bindings.Update_RecipeName(obj.RecipeName, DATA_CHANGED); bindings.Update_DateUpdated(obj.DateUpdated, DATA_CHANGED); bindings.Update_Rating(obj.Rating, DATA_CHANGED); bindings.Update_BadgeSource(obj.BadgeSource, DATA_CHANGED); } } else { switch (propName) { case "RecipeName": { if (obj != null) { bindings.Update_RecipeName(obj.RecipeName, DATA_CHANGED); } break; } case "DateUpdated": { if (obj != null) { bindings.Update_DateUpdated(obj.DateUpdated, DATA_CHANGED); } break; } case "Rating": { if (obj != null) { bindings.Update_Rating(obj.Rating, DATA_CHANGED); } break; } case "BadgeSource": { if (obj != null) { bindings.Update_BadgeSource(obj.BadgeSource, DATA_CHANGED); } break; } default: break; } } } }
// MainPage_obj2_Bindings public void SetDataRoot(global::RecipeRate.ViewModels.RecipeRatingViewModel newDataRoot) { this.bindingsTracking.ReleaseAllListeners(); this.dataRoot = newDataRoot; }