/// <summary> /// Moves a slected channel up. /// </summary> public void MoveUp() { var selectedIndex = SelectedChannelSelectedIndex; if (selectedIndex > 1) { var itemToMoveUp = SelectedChannels[selectedIndex]; SelectedChannels.RemoveAt(selectedIndex); SelectedChannels.Insert(selectedIndex - 1, itemToMoveUp); SelectedChannelSelectedIndex = selectedIndex - 1; NotifyOfPropertyChange(() => SelectedChannelSelectedIndex); } }
/// <summary> /// Moves a selected channel down. /// </summary> public void MoveDown() { var selectedIndex = SelectedChannelSelectedIndex; if (selectedIndex + 1 < SelectedChannels.Count) { var itemToMoveDown = SelectedChannels[selectedIndex]; if (selectedIndex == 0 && itemToMoveDown.Equals(IndexChannel.Mnemonic)) { return; } SelectedChannels.RemoveAt(selectedIndex); SelectedChannels.Insert(selectedIndex + 1, itemToMoveDown); SelectedChannelSelectedIndex = selectedIndex + 1; NotifyOfPropertyChange(() => SelectedChannelSelectedIndex); } }