Example #1
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
            {
                tool.debug("Starting MusicGUI");
                window       = Window.GetWindow(this);
                windowHandle = new WindowInteropHelper(window).Handle;
                window.Title = "Music GUI";
                SaveSettings.RestoreMainControl(this);

                window.Closing += Window_Closing;
                playlistControl.LinkControls(fileControl);
                tool.debug("Music GUI Loaded");

                GetAllResources();
                if (!consoleCheckBox.IsChecked.Value)
                {
                    tool.HideConsole();
                }

                MusicPlayer.Player.PlayEvent += Player_PlayEvent;
                SetWindowTitleFromCurrentSong();

                if (Current == null)
                {
                    Current = this;
                }

                // Database.Instance.PopulateMusicFiles();
            }
        }
Example #2
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     SaveSettings.SaveMainControl(this);
     MusicPlayer.Player.Stop();
 }