Exemple #1
0
        public void Update(DCInsidePageArticle article)
        {
            Article    = article;
            Title.Text = article.title;
            if (article.uid != "")
            {
                Author.Text = $"{article.nick} ({article.uid})";
            }
            else
            {
                Author.Text = $"{article.nick} ({article.ip})";
            }
            ViewCount.Text = article.count + " Views";
            //DateTime.Text = article.date.ToString();
            var upvote = article.recommend.ToInt();

            if (upvote > 0)
            {
                Rating.Text            = article.recommend;
                UpVotePanel.Visibility = Visibility.Visible;

                if (upvote < 5)
                {
                    RatingShadow.Opacity = 0;
                    Rating.Opacity       = 0.56;
                    Rating.Foreground    = Brushes.White;
                }
                else if (upvote < 10)
                {
                    RatingShadow.Opacity = 1;
                    RatingShadow.Color   = Colors.Yellow;
                    Rating.Opacity       = 1;
                    Rating.Foreground    = Brushes.Yellow;
                }
                else if (upvote < 15)
                {
                    RatingShadow.Opacity = 1;
                    RatingShadow.Color   = Colors.Orange;
                    Rating.Opacity       = 1;
                    Rating.Foreground    = Brushes.Orange;
                }
                else
                {
                    RatingShadow.Opacity = 1;
                    RatingShadow.Color   = Colors.HotPink;
                    Rating.Opacity       = 1;
                    Rating.Foreground    = Brushes.HotPink;
                }
            }
        }
Exemple #2
0
        public ThumbnailItem(DCInsidePageArticle article, bool r2l = false)
        {
            InitializeComponent();

            if (!r2l)
            {
                LoadedAnimation.Actions.Clear();
            }
            if (DCGalleryAnalyzer.Instance.Model.is_minor_gallery)
            {
                URL = $"https://gall.dcinside.com/mgallery/board/view/?id={DCGalleryAnalyzer.Instance.Model.gallery_id}&no={article.no}";
            }
            else
            {
                URL = $"https://gall.dcinside.com/board/view/?id={DCGalleryAnalyzer.Instance.Model.gallery_id}&no={article.no}";
            }
            Update(article);
            Loaded += ThumbnailItem_Loaded;
        }
        public ThumbnailItem(DCInsidePageArticle article)
        {
            InitializeComponent();

            this.article = article;
            Title.Text   = article.title;
            if (article.uid != "")
            {
                Author.Text = $"{article.nick} ({article.uid})";
            }
            else
            {
                Author.Text = $"{article.nick} ({article.ip})";
            }
            ViewCount.Text = article.count + " Views";
            if (DCGalleryAnalyzer.Instance.Model.is_minor_gallery)
            {
                URL = $"https://gall.dcinside.com/mgallery/board/view/?id={DCGalleryAnalyzer.Instance.Model.gallery_id}&no={article.no}";
            }
            else
            {
                URL = $"https://gall.dcinside.com/board/view/?id={DCGalleryAnalyzer.Instance.Model.gallery_id}&no={article.no}";
            }
            //DateTime.Text = article.date.ToString();
            var upvote = article.recommend.ToInt();

            if (upvote > 0)
            {
                Rating.Text            = article.recommend;
                UpVotePanel.Visibility = Visibility.Visible;

                if (upvote < 5)
                {
                    RatingShadow.Opacity = 0;
                    Rating.Opacity       = 0.56;
                    Rating.Foreground    = Brushes.White;
                }
                else if (upvote < 10)
                {
                    RatingShadow.Opacity = 1;
                    RatingShadow.Color   = Colors.Yellow;
                    Rating.Opacity       = 1;
                    Rating.Foreground    = Brushes.Yellow;
                }
                else if (upvote < 15)
                {
                    RatingShadow.Opacity = 1;
                    RatingShadow.Color   = Colors.Orange;
                    Rating.Opacity       = 1;
                    Rating.Foreground    = Brushes.Orange;
                }
                else
                {
                    RatingShadow.Opacity = 1;
                    RatingShadow.Color   = Colors.HotPink;
                    Rating.Opacity       = 1;
                    Rating.Foreground    = Brushes.HotPink;
                }
            }
            Loaded += ThumbnailItem_Loaded;
        }