From b5acc276a59879b5b5a14a1e9efb38b633e53a68 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 29 Mar 2013 14:01:06 +0400 Subject: PostItem refactoring --- Juick/ViewModels/PostItem.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Juick/ViewModels/PostItem.cs') diff --git a/Juick/ViewModels/PostItem.cs b/Juick/ViewModels/PostItem.cs index 7e30a43..2072cf5 100644 --- a/Juick/ViewModels/PostItem.cs +++ b/Juick/ViewModels/PostItem.cs @@ -8,23 +8,24 @@ namespace Juick.ViewModels { public class PostItem { - public PostItem() - { - - } - public PostItem(Message message) { MID = message.Mid; - MessageUri = string.Format("/ThreadView.xaml?mid={0}", MID); RID = message.Rid; Username = message.User.UName; + Status = string.Format("Posted on: {0}, replies: {1}", message.Timestamp, message.Replies); + MessageText = HttpUtility.HtmlDecode(message.Body); if (message.Tags != null) { MessageText = string.Join(", ", message.Tags) + Environment.NewLine + MessageText; } + AvatarUri = new Uri(string.Format("http://i.juick.com/as/{0}.png", message.User.Uid), UriKind.Absolute); + if (message.Photo != null) + { + Attachment = new Uri(message.Photo.Small, UriKind.Absolute); + } } public int MID {get;set;} @@ -36,11 +37,10 @@ namespace Juick.ViewModels public Uri AvatarUri {get;set;} public Uri Attachment {get;set;} - - public string MessageText {get;set;} + public string Status {get;set;} - - public string MessageUri {get;set;} + + public string MessageText { get; set; } } } \ No newline at end of file -- cgit v1.2.3