public PlayerWindow() { DependencyUtility.BuildUp(this); InitializeComponent(); this.Left = Properties.Settings.Default.Left; this.Top = Properties.Settings.Default.Top; new DraggableWindow(this).DragFinished += (s, e) => { Properties.Settings.Default.Left = this.Left; Properties.Settings.Default.Top = this.Top; Properties.Settings.Default.Save(); }; musicSelectControl.Bind(musicPlayer.GetList().ToList()); musicSelectControl.MusicChanged += musicItem => { musicPlayer.ChangeMusic(musicItem); musicPlayer.Play(); }; pauseButton.Visibility = Visibility.Hidden; musicPlayer.MusicPlayed += musicPlayer_MusicPlayed; musicPlayer.MusicPaused += musicPlayer_MusicStopped; musicPlayer.MusicChanged += musicPlayer_MusicChanged; musicPlayer.Show += MusicPlayer_Show; musicPlayer.TrackAdded += MusicPlayer_TrackAdded; musicPlayer.TrackDeleted += MusicPlayer_TrackDeleted; trackProgress.BindData(musicPlayer); musicPlayer_MusicChanged(null); }
public SettingsWindow() { InitializeComponent(); DependencyUtility.BuildUp(this); autoRunMenuItem.IsChecked = AutorunHelper.IsAutorunRegistered; playerWindow = new VkMusic.UI.PlayerWindow(); MyNotifyIcon.BeforeShowTrayPopup += MyNotifyIcon_BeforeShowTrayPopup;; MusicWorker.SynchronizationStarted += MusicWorker_SynchronizationStarted; MusicWorker.SynchronizationCompleted += MusicWorker_SynchronizationCompleted; mainWindow = new MainWindow(); MusicPlayer.MusicPlayed += () => startPauseItem.Header = "Пауза"; MusicPlayer.MusicPaused += () => startPauseItem.Header = "Старт"; playerWindow.Topmost = alwaysOnTopItem.IsChecked = Properties.Settings.Default.AlwaysOnTop; }