Пример #1
0
 public static IDisposable BindInformer(
     this InformerModel model,
     Aggregate aggregate)
 {
     return(BindInformer(
                model,
                aggregate,
                Locator.Current.GetService <IAvatarLoader>()));
 }
Пример #2
0
 public static IDisposable BindInformer(
     this InformerModel model,
     Chat chat)
 {
     return(BindInformer(
                model,
                chat,
                Locator.Current.GetService <IAvatarLoader>()));
 }
Пример #3
0
        public static IDisposable BindInformer(
            this InformerModel model,
            Aggregate aggregate,
            IAvatarLoader avatarLoader)
        {
            model.Title = aggregate.Id.ToString();
            model.Label = aggregate.Id.ToString();

            return(Disposable.Empty);
        }
Пример #4
0
        public static IDisposable BindInformer(
            this InformerModel model,
            Chat chat,
            IAvatarLoader avatarLoader)
        {
            model.Title = chat.ChatData.Title;
            model.Label = chat.ChatData.Title;

            return(avatarLoader.LoadAvatar(chat.ChatData, AvatarSize.Regular)
                   .SubscribeOn(RxApp.TaskpoolScheduler)
                   .ObserveOn(RxApp.MainThreadScheduler)
                   .Accept(avatar =>
            {
                model.Avatar = avatar;
            }));
        }