public NewsFeedElement(string imageUrl, DateTimeOffset time, IEnumerable<TextBlock> headerBlocks, IEnumerable<TextBlock> bodyBlocks, UIImage littleImage, Action tapped)
        {
            Uri.TryCreate(imageUrl, UriKind.Absolute, out _imageUri);
            _time = time.ToDaysAgo();
            _actionImage = littleImage;
            _tapped = tapped;

            var header = CreateAttributedStringFromBlocks(headerBlocks);
            _attributedHeader = header.Item1;
            _headerLinks = header.Item2;

            var body = CreateAttributedStringFromBlocks(bodyBlocks);
            _attributedBody = body.Item1;
            _bodyLinks = body.Item2;
            _bodyBlocks = bodyBlocks.Count();
        }
Example #2
0
        public NewsFeedElement(string imageUrl, DateTimeOffset time, IEnumerable <TextBlock> headerBlocks, IEnumerable <TextBlock> bodyBlocks, UIImage littleImage, Action tapped)
        {
            Uri.TryCreate(imageUrl, UriKind.Absolute, out _imageUri);
            _time        = time.ToDaysAgo();
            _actionImage = littleImage;
            _tapped      = tapped;

            var header = CreateAttributedStringFromBlocks(headerBlocks);

            _attributedHeader = header.Item1;
            _headerLinks      = header.Item2;

            var body = CreateAttributedStringFromBlocks(bodyBlocks);

            _attributedBody = body.Item1;
            _bodyLinks      = body.Item2;
            _bodyBlocks     = bodyBlocks.Count();
        }
Example #3
0
        public void Bind(string title, string status, string priority, string assigned, DateTimeOffset lastUpdated, string id, string kind)
        {
            Caption.Text   = title;
            Label1.Text    = status;
            Label2.Text    = priority;
            Label3.Text    = assigned;
            Label4.Text    = lastUpdated.ToDaysAgo();
            Number.Text    = "#" + id;
            IssueType.Text = kind;

            /*
             * if (model.CommentCount > 0)
             * {
             *  var ms = model.CommentCount.ToString ();
             *  var ssize = ms.MonoStringLength(CountFont);
             *  var boxWidth = Math.Min (22 + ssize, 18);
             *  AddSubview(new CounterView(model.CommentCount) { Frame = new RectangleF(Bounds.Width-30-boxWidth, Bounds.Height / 2 - 8, boxWidth, 16) });
             * }
             */
        }
        public void Bind(string title, string status, string priority, string assigned, DateTimeOffset lastUpdated, string id, string kind)
        {
            Caption.Text = title;
            Label1.Text = status;
            Label2.Text = priority;
            Label3.Text = assigned;
            Label4.Text = lastUpdated.ToDaysAgo();
            Number.Text = "#" + id;
            IssueType.Text = kind;

            /*
            if (model.CommentCount > 0)
            {
                var ms = model.CommentCount.ToString ();
                var ssize = ms.MonoStringLength(CountFont);
                var boxWidth = Math.Min (22 + ssize, 18);
                AddSubview(new CounterView(model.CommentCount) { Frame = new RectangleF(Bounds.Width-30-boxWidth, Bounds.Height / 2 - 8, boxWidth, 16) });
            }
            */
        }