void SyncStart(object sender, RoutedEventArgs e) { try { DeckA.Play(); } catch { } try { DeckB.Play(); } catch { } }
public MainViewModel() { _ofd = new OpenFileDialog { CheckFileExists = true, CheckPathExists = true, Filter = "Audio Files|*.mp3;*.wav;*.wma;*.aac;*.m4a", Title = "Select Audio File", ValidateNames = true, Multiselect = true }; OpenCommand = new DelegateCommand(() => { if (!_ofd.ShowDialog().Value) { return; } foreach (var fileName in _ofd.FileNames) { PlaylistItems.Add(new PlaylistLabel(fileName)); } }); SyncStartCommand = new DelegateCommand(() => { try { DeckA.Play(); } catch { } try { DeckB.Play(); } catch { } }); DeleteCommand = new DelegateCommand <IList>(list => { var items = new PlaylistLabel[list.Count]; list.CopyTo(items, 0); foreach (var item in items) { PlaylistItems.Remove(item); } }); AutoCrossfadeCommand = new DelegateCommand <string>(Param => { _autoCrossfadeTarget = double.Parse(Param.ToString()); _autoCrossfadeDelta = (_autoCrossfadeTarget - Crossfade) / 200; StartAutoCrossfade(); }); }