private void button_Click(object sender, RoutedEventArgs e)
        {
            _item.progress = ProgressBox.Text;
            _item.LastEdited = (int)DateTime.Now.Subtract(DateTime.MinValue.AddYears(1969)).TotalSeconds;
            _card.UpdateContent(_item);

            MainWindow mainWindow = Application.Current.Windows.OfType<MainWindow>().FirstOrDefault();
            if (mainWindow != null)
            {
                mainWindow.SaveData();
                mainWindow.SetupContextMenu();
                mainWindow.RefreshSort();
            }
            this.Close();
        }
Beispiel #2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            _item.progress  = ProgressBox.Text;
            _item.season    = Int32.Parse(SeasonBox.Text);
            _item.type      = TypeBox.SelectedItem == TypeBox.Items[0] ? Type.Movie : Type.Series;
            _item.episode   = Int32.Parse(EpisodeBox.Text);
            _item.name      = NameBox.Text;
            _item.completed = (bool)Completed.IsChecked;

            _card.UpdateContent(_item);
            MainWindow mainWindow = Application.Current.Windows.OfType <MainWindow>().FirstOrDefault();

            if (mainWindow != null)
            {
                mainWindow.SaveData();
            }
            this.Close();
        }