public void DataContextChangedHandler(global::Windows.UI.Xaml.FrameworkElement sender, global::Windows.UI.Xaml.DataContextChangedEventArgs args) { global::MusicLibrary.MusicClass data = args.NewValue as global::MusicLibrary.MusicClass; if (args.NewValue != null && data == null) { throw new global::System.ArgumentException("Incorrect type passed into template. Based on the x:DataType global::MusicLibrary.MusicClass was expected."); } this.SetDataRoot(data); this.Update(); }
// Update methods for each path node used in binding steps. private void Update_(global::MusicLibrary.MusicClass obj, int phase) { if (obj != null) { if ((phase & (NOT_PHASED | (1 << 0))) != 0) { this.Update_Title(obj.Title, phase); this.Update_Artist(obj.Artist, phase); this.Update_Album(obj.Album, phase); this.Update_Length(obj.Length, phase); } if ((phase & (NOT_PHASED | (1 << 0) | (1 << 1))) != 0) { this.Update_Genre(obj.Genre, phase); } } }
// PlayMusic_obj2_Bindings public void SetDataRoot(global::MusicLibrary.MusicClass newDataRoot) { this.dataRoot = newDataRoot; }