private void ClockAdd_Click(object sender, RoutedEventArgs e) { if (SourceClocks.SelectedItems.Count > 0) { foreach (var OneItem in SourceClocks.SelectedItems) { ViewModel.Clocks.Add(OneItem.ToString()); } ViewModel.Setup(); } }
private void ClockRemove_Click(object sender, RoutedEventArgs e) { if (DestinationClocks.SelectedItems.Count > 0) { List <string> ToRemove = new List <string>(); foreach (var OneItem in DestinationClocks.SelectedItems) { ToRemove.Add(OneItem.ToString()); } ToRemove.ForEach(item => ViewModel.Clocks.Remove(item)); ViewModel.Setup(); } }
private void ConversionDown_Click(object sender, RoutedEventArgs e) { if (DestinationConversions.SelectedItems.Count > 0) { List <string> ToMove = new List <string>(); foreach (var OneItem in DestinationConversions.SelectedItems) { ToMove.Add(OneItem.ToString()); } ToMove.ForEach(item => { int Index = ViewModel.Conversions.IndexOf(item); if (Index < ViewModel.Conversions.Count - 1) { ViewModel.Conversions.Move(Index, Index + 1); } }); } }