diff options
Diffstat (limited to 'Juick/ViewModels')
-rw-r--r-- | Juick/ViewModels/MessageListViewModelBase.cs | 8 | ||||
-rw-r--r-- | Juick/ViewModels/MessageViewModel.cs | 12 |
2 files changed, 11 insertions, 9 deletions
diff --git a/Juick/ViewModels/MessageListViewModelBase.cs b/Juick/ViewModels/MessageListViewModelBase.cs index 60c0a94..f49ef4f 100644 --- a/Juick/ViewModels/MessageListViewModelBase.cs +++ b/Juick/ViewModels/MessageListViewModelBase.cs @@ -91,10 +91,12 @@ namespace Juick.ViewModels foreach (var post in response.Data)
{
var status = string.Format("Posted on: {0}, replies: {1}", post.Timestamp, post.Replies);
- var item = new MessageViewModel(post) { Status = status };
+ var item = new MessageViewModel(post)
+ {
+ Status = status,
+ AvatarUri = new Uri(string.Format("http://i.juick.com/as/{0}.png", post.User.Uid), UriKind.Absolute)
+ };
Items.Add(item);
- var imageUri = new Uri(string.Format("http://i.juick.com/as/{0}.png", post.User.Uid), UriKind.Absolute);
- item.UserAvatar = new BitmapImage { UriSource = imageUri };
if (post.Photo != null)
{
item.Attachment = new BitmapImage { UriSource = new Uri(post.Photo.Small, UriKind.Absolute) };
diff --git a/Juick/ViewModels/MessageViewModel.cs b/Juick/ViewModels/MessageViewModel.cs index 6a53669..08cdcaa 100644 --- a/Juick/ViewModels/MessageViewModel.cs +++ b/Juick/ViewModels/MessageViewModel.cs @@ -88,16 +88,16 @@ namespace Juick.ViewModels }
}
- private BitmapImage _avatar;
- public BitmapImage UserAvatar
+ private Uri _avatarUri;
+ public Uri AvatarUri
{
- get { return _avatar; }
+ get { return _avatarUri; }
set
{
- if (value != _avatar)
+ if (value != _avatarUri)
{
- _avatar = value;
- NotifyPropertyChanged("UserAvatar");
+ _avatarUri = value;
+ NotifyPropertyChanged("AvatarUri");
}
}
}
|