Beispiel #1
0
 private IDisposable LoadAvatar(IUserLoader userLoader, IAvatarLoader avatarLoader)
 {
     return(userLoader
            .GetMe()
            .SelectMany(user => avatarLoader.LoadAvatar(user.UserData, AvatarSize.Big))
            .SubscribeOn(TaskPoolScheduler.Default)
            .ObserveOn(AvaloniaScheduler.Instance)
            .Subscribe(avatar =>
     {
         Avatar = avatar;
     }));
 }
 private IDisposable BindAvatar(
     IUserLoader userLoader,
     IAvatarLoader avatarLoader)
 {
     return(userLoader
            .GetMe()
            .SelectMany(user => avatarLoader.LoadAvatar(user.UserData))
            .SubscribeOn(TaskPoolScheduler.Default)
            .ObserveOn(RxApp.MainThreadScheduler)
            .Subscribe(avatar =>
     {
         Model.Avatar = avatar;
     }));
 }
Beispiel #3
0
 public static IDisposable BindUserAvatar(
     this NavigationModel model,
     IAvatarLoader avatarLoader,
     IUserLoader userLoader)
 {
     return(userLoader
            .GetMe()
            .SelectMany(user => avatarLoader.LoadAvatar(user.UserData, AvatarSize.Regular))
            .SubscribeOn(RxApp.TaskpoolScheduler)
            .ObserveOn(RxApp.MainThreadScheduler)
            .Accept(avatar =>
     {
         model.Avatar = avatar;
     }));
 }