/// <summary> /// Invoked when the user edits the value of a property /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event data</param> /// <remarks>Will save the text to the temporary structure</remarks> private void EditableTextBlock_Edited(object sender, EditableTextBlockEventArgs e) { EditableTextBlock etb = sender as EditableTextBlock; string prop = etb.Tag as string; PropertyData p = null; foreach (PropertyData pd in properties) { if (pd.Name == prop) { p = pd; break; } } if (p != null) { p.Value = e.NewText; bool multi = p.Value == U.T("PropertiesDetailsMultipleValues"); object curObj = GetTag(tempTrack, p.Name); string cur = curObj as string; p.Edited = curObj == null || (p.Value != curObj.ToString() && !(p.Name == "Track" && tempTrack.Track == 881102 && multi) && !(p.Name == "Year" && tempTrack.Year == 881102 && multi)); } ToggleButtons(); }
/// <summary> /// Invoked when the "New playlist" item has been edited. /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event data</param> private void CreateNewPlaylist_Edited(object sender, EditableTextBlockEventArgs e) { if (e.NewText != U.T("NavigationCreateNew") && e.NewText != "") { List <object> addQueue = AddToPlaylistQueue; PlaylistManager.CreatePlaylist(e.NewText, addQueue.Count == 0); if (addQueue.Count > 0) { PlaylistManager.AddToPlaylist(addQueue, e.NewText); addQueue.Clear(); } } else { CreateNewPlaylist_Canceled(sender, e); } }
/// <summary> /// Invoked when a field has been edited /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event data</param> private void Field_Edited(object sender, EditableTextBlockEventArgs e) { EditableTextBlock etb = sender as EditableTextBlock; OnFieldEdited(etb.Tag as string, e.NewText); }
/// <summary> /// Invoked when a playlist's name has been edited. /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event data</param> public void Playlist_Edited(object sender, EditableTextBlockEventArgs e) { PlaylistManager.RenamePlaylist(e.OldText, e.NewText); SelectPlaylist(e.NewText); }
/// <summary> /// Invoked when the "New playlist" item has been edited. /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event data</param> private void CreateNewPlaylist_Edited(object sender, EditableTextBlockEventArgs e) { if (e.NewText != U.T("NavigationCreateNew") && e.NewText != "") { List<object> addQueue = AddToPlaylistQueue; PlaylistManager.CreatePlaylist(e.NewText, addQueue.Count == 0); if (addQueue.Count > 0) { PlaylistManager.AddToPlaylist(addQueue, e.NewText); addQueue.Clear(); } } else CreateNewPlaylist_Canceled(sender, e); }
/// <summary> /// Invoked when the user changes the device name. /// Will send the new name to the server. /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event data</param> private void DeviceName_Edited(object sender, EditableTextBlockEventArgs e) { ServiceManager.DeviceName = e.NewText; }