Esempio n. 1
0
        public NewsItem(string title, string url, string description, string image, string category)
        {
            InitializeComponent();
            Img.Height  = 150;
            ImageHeight = 150;
            ReadMore.Text("READ MORE");
            ReadMore.ChangeTextColor("#FFF");
            ReadMore.RippleColor(Colors.White);
            try
            {
                var bitmap = new BitmapImage(new Uri(image));
                Img.Source = bitmap;
            }
            catch
            {
            }
            CategoryLabel.Content = category;
            _title = title;

            _url         = url;
            _description = description;
            label.Text   = _title;
            if (_description.Contains("• "))
            {
                string replace = _description.Replace("• ", "");
                if (replace.Contains("&#34"))
                {
                    string replace2 = replace.Replace("&#34", "");
                    DescriptionText.Text = replace2;
                }
                else
                {
                    DescriptionText.Text = replace;
                }
            }
            else
            {
                if (_description.Contains("&#34"))
                {
                    string replace2 = _description.Replace("&#34", "");
                    DescriptionText.Text = replace2;
                }
                else
                {
                    DescriptionText.Text = _description;
                }
            }
            this.Width = 244;

            Loaded += NewsItem_Loaded;
        }