Example #1
0
        public ShowTileViewModel(FavShowData show)
        {
            _dispatcher = Dispatcher.CurrentDispatcher;
            _show = show;
               // _showViewModel  = new ShowViewModel(_show);

            Title= _show.Name;
            IsLoadingVisible = (_show.IsLoading) ? Visibility.Visible : Visibility.Collapsed;
            RecalcText();
            RecalcNextPrevEpText();
            Background = !String.IsNullOrWhiteSpace(_show.Cover) ? new CachedBitmap(_show.Cover) : null;
            _show.PropertyChanged += _show_PropertyChanged;
        }
Example #2
0
        private void AddSelectedShow()
        {
            if (ListViewAutoCompl.HasItems && ListViewAutoCompl.SelectedItem == null)
                ListViewAutoCompl.SelectedIndex = 0;

            if (ListViewAutoCompl.SelectedItem != null)
            {
                foreach (var item in ListViewAutoCompl.SelectedItems)
                {
                    var selectedShow = (KeyValuePair<string, string>)item;

                    if (_setti.TvShows.Any(t => t.Show.Url == selectedShow.Value))
                    {
                        return;
                    }

                    TextBoxAutoComl.Text = "";
                    AddShowFlyout.IsOpen = false;

                    FavShowData show = new FavShowData(new ShowData { Name = selectedShow.Key, Url = selectedShow.Value }, true);

                    _setti.TvShows.Add(show);
                    Stats.TrackAction(Stats.TrackActivity.ShowAdd);

                    show.AddToDatabase(Database.DatabaseWriter.db);
                }
            }
        }