public MainWindowViewModel() { InitPlayList(); InitMusicList(PlayLists.First()); Lyric = new List <LyricItemViemModel>(); play = new MusicPlay(); PlayOrder = 0; MaxTime = 1; PlayIcon = new BitmapImage(new Uri("/Image/full_play.png", UriKind.Relative)); OrderIcon = new BitmapImage(new Uri("/Image/full_recycle.png", UriKind.Relative)); Volume = play.GetVolume(); play.dt = new System.Windows.Threading.DispatcherTimer(); play.dt.Interval = TimeSpan.FromSeconds(0.1); play.dt.Tick += Dt_Tick; OpenFileCommand = new DelegateCommand(OpenMusic); OpenFolderCommand = new DelegateCommand(OpenFolder); DeleteMusicCommand = new DelegateCommand(DeleteMusic); PlayListClickCommand = new DelegateCommand(PlayListClick); MusicListDoubleClickCommand = new DelegateCommand(MusicListDoubleClick); LastMusicCommand = new DelegateCommand(LastMusic); PlayMusicCommand = new DelegateCommand(PlayMusic); NextMusicCommand = new DelegateCommand(NextMusic); StopMusicCommand = new DelegateCommand(StopMusic); PlayOrderCommand = new DelegateCommand(ClickPlayOrder); TimeControlButtonDown = new DelegateCommand(TimeControlButtonDownExcute); TimeControlButtonUp = new DelegateCommand <Slider>(TimeControlButtonUpExcute); VolumeChangedCommand = new DelegateCommand(VolumeChanged); }