summaryrefslogtreecommitdiff
path: root/Juick/ViewModels/MainViewModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewModels/MainViewModel.cs')
-rw-r--r--Juick/ViewModels/MainViewModel.cs37
1 files changed, 10 insertions, 27 deletions
diff --git a/Juick/ViewModels/MainViewModel.cs b/Juick/ViewModels/MainViewModel.cs
index ed244d7..3ee4a16 100644
--- a/Juick/ViewModels/MainViewModel.cs
+++ b/Juick/ViewModels/MainViewModel.cs
@@ -66,20 +66,13 @@ namespace Juick.ViewModels
post.Replies)
};
MyFeed.Add(item);
- var imageRequest =
- new RestRequest(
- string.Format("/as/{0}.png",
- post.User.Uid));
- App.AvatarClient.ExecuteAsync(
- imageRequest, restResponse =>
+ var imageUri = new Uri(string.Format("http://i.juick.com/as/{0}.png", post.User.Uid), UriKind.Absolute);
+ item.UserAvatar = new BitmapImage
{
- item.UserAvatar = new BitmapImage
- ();
- item.UserAvatar.SetSource(new MemoryStream(restResponse.RawBytes));
- item.
- NotifyPropertyChanged
- ("UserAvatar");
- });
+ UriSource = imageUri
+ };
+ item.NotifyPropertyChanged("UserAvatar");
+
});
NotifyPropertyChanged("MyFeed");
@@ -102,20 +95,10 @@ namespace Juick.ViewModels
post.Replies)
};
Last.Add(item);
- var imageRequest =
- new RestRequest(
- string.Format("/as/{0}.png",
- post.User.Uid));
- App.AvatarClient.ExecuteAsync(
- imageRequest, restResponse =>
- {
- item.UserAvatar = new BitmapImage
- ();
- item.UserAvatar.SetSource(new MemoryStream(restResponse.RawBytes));
- item.
- NotifyPropertyChanged
- ("UserAvatar");
- });
+ var imageUri = new Uri(string.Format("http://i.juick.com/as/{0}.png", post.User.Uid), UriKind.Absolute);
+ item.UserAvatar = new BitmapImage {UriSource = imageUri};
+ item.NotifyPropertyChanged("UserAvatar");
+
if (post.Photo != null)
{
item.Attachment = new BitmapImage {UriSource = new Uri(post.Photo.Small, UriKind.Absolute)};