Пример #1
0
        private void Window_Closed(object sender, EventArgs e)
        {
            MyDialogWindow dialog = new MyDialogWindow();

            dialog.TX.Text = "Сохранить данные?";
            dialog.Owner   = this;
            dialog.ShowDialog();
            if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
            {
                SerializeData();
            }
        }
Пример #2
0
        private void RemovePL_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            SettPopup.IsOpen = false;
            MyDialogWindow dialog = new MyDialogWindow();

            dialog.TX.Text = "Delete this playlist?";
            dialog.Owner   = this;
            dialog.ShowDialog();
            if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
            {
                playLists.Remove((sender as TextBlock).DataContext as PlayList); //delete the playlist
                PL_ListBox.ItemsSource = new List <PlayList>(playLists);         //updating the playlist window
                SetVisiblePlayListsControl();                                    //display the playlist window
                CenterAnim(PListControl);
            }
        }
        private void RemovePL_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            SettPopup.IsOpen = false;
            MyDialogWindow dialog = new MyDialogWindow();

            dialog.TX.Text = "Удалить этот плейлист?";
            dialog.Owner   = this;
            dialog.ShowDialog();
            if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
            {
                playLists.Remove((sender as TextBlock).DataContext as PlayList); //удаляем плейлист
                PL_ListBox.ItemsSource = new List <PlayList>(playLists);         //обновляем окно плейлистов
                SetVisiblePlayListsControl();                                    //отображаем окно плейлистов
                CenterAnim(PListControl);
            }
        }
Пример #4
0
        private void ChangeAudio(Audio audioContext)
        {
            ms.Source = new Uri(audioContext.DirectoryName + "\\" + audioContext.Name);
            BottomPanel.Visibility  = Visibility.Visible;
            TopPlayGrid.DataContext = audioContext; // обновляем верхнюю панель

            Playing = true;
            ms.Play();

            CurrentIndex = CurrentList.IndexOf(audioContext);

            (PlayButton.Child as Image).Source = LoadImage(@"pack://*****:*****@"pack://application:,,,/Resources/NoImg.jpg", true);
            }
            BottomInfo.DataContext = audioContext;
        }
Пример #5
0
        private void ChangeAudio(Audio audioContext)
        {
            ms.Source = new Uri(audioContext.DirectoryName + "\\" + audioContext.Name);
            BottomPanel.Visibility  = Visibility.Visible;
            TopPlayGrid.DataContext = audioContext; // update the top panel

            Playing = true;
            ms.Play();

            CurrentIndex = CurrentList.IndexOf(audioContext);

            (PlayButton.Child as Image).Source = LoadImage(@"pack://*****:*****@"pack://application:,,,/Resources/NoImg.jpg", true);
            }
            BottomInfo.DataContext = audioContext;
        }