Example #1
0
        void btnViewSeries_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                VM_AnimeRating animeRanking = DataContext as VM_AnimeRating;
                if (animeRanking == null)
                {
                    return;
                }

                if (animeRanking.AnimeSeries == null)
                {
                    MessageBox.Show(Shoko.Commons.Properties.Resources.Rankings_AnimeNotInCollection);
                    return;
                }

                MainWindow mainwdw = (MainWindow)Window.GetWindow(this);

                if (mainwdw == null)
                {
                    return;
                }
                mainwdw.ShowPinnedSeries(animeRanking.AnimeSeries);
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }
Example #2
0
        void dgRankings_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid _DataGrid = sender as DataGrid;

            VM_AnimeRating animeRanking = _DataGrid.SelectedItem as VM_AnimeRating;

            if (animeRanking == null)
            {
                ShowAnimeDetails = false;
                return;
            }

            ShowDetails(animeRanking);
            ShowAnimeDetails = true;
        }
Example #3
0
        void RankingsControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            try
            {
                VM_AnimeRating animeRanking = DataContext as VM_AnimeRating;
                if (animeRanking == null)
                {
                    return;
                }

                AnimeHasSeries = animeRanking.AnimeSeries != null;
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }
Example #4
0
        void cRating_OnRatingValueChangedEvent(RatingValueEventArgs ev)
        {
            VM_AnimeRating animeRating = DataContext as VM_AnimeRating;

            if (animeRating == null)
            {
                return;
            }

            VM_AnimeSeries_User ser = animeRating.AnimeSeries;

            if (ser == null)
            {
                return;
            }

            try
            {
                decimal rating = (decimal)ev.RatingValue;

                int voteType = 1;
                if (ser.AniDBAnime.AniDBAnime.FinishedAiring)
                {
                    voteType = 2;
                }

                animeRating.UserRating = rating;

                VM_ShokoServer.Instance.VoteAnime(ser.AniDB_ID, rating, voteType);

                // refresh the data
                VM_MainListHelper.Instance.UpdateHeirarchy(ser);
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }
Example #5
0
 private void ShowDetails(VM_AnimeRating ranking)
 {
     DataContext = ranking;
 }