private async void Button_Click(object sender, RoutedEventArgs e)
        {
            if (textName.Text.Length == 0)
            {
                MessageBox.Show("You must enter a new playlist name.", "PlexFlux", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            IsEnabled = false;

            try
            {
                var app = (App)Application.Current;
                CreatedPlaylist = await app.plexClient.CreatePlaylist(textName.Text);

                var mainWindow = MainWindow.GetInstance();
                await mainWindow.FetchPlaylists();

                IsEnabled    = true;
                DialogResult = true;
                Close();
            }
            catch
            {
                MessageBox.Show("Could not fetch data from remote server.", "PlexFlux", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            finally
            {
                IsEnabled = true;
            }
        }
        public NewPlaylistWindow()
        {
            InitializeComponent();
            CreatedPlaylist = null;

            textName.Focus();
        }
        public BrowsePlaylist(ContextMenu contextMenu, PlexPlaylist playlist)
        {
            this.contextMenu = contextMenu;
            Playlist         = playlist;
            Tracks           = new ObservableCollection <PlexTrack>();

            InitializeComponent();
        }
Example #4
0
        public PlaylistSelectionWindow()
        {
            Playlists        = new ObservableCollection <PlexPlaylist>();
            SelectedPlaylist = null;

            InitializeComponent();
            Initialize();
        }
Example #5
0
        private void NewPlaylistButton_Click(object sender, RoutedEventArgs e)
        {
            var window = new NewPlaylistWindow();

            if (window.ShowDialog() != true)
            {
                return;
            }

            SelectedPlaylist = window.CreatedPlaylist;
            DialogResult     = true;
            Close();
        }
Example #6
0
 private void PlaylistButton_Click(object sender, RoutedEventArgs e)
 {
     SelectedPlaylist = (PlexPlaylist)((Button)sender).Tag;
     DialogResult     = true;
     Close();
 }