Пример #1
0
            public ItemsCollection(IProtoService protoService, IEventAggregator aggregator, ChatsViewModel viewModel, ChatList chatList, IChatFilter filter = null)
                : base(new ChatComparer(), true)
            {
                _protoService = protoService;
                _aggregator   = aggregator;

                _viewModel = viewModel;

                _chatList = chatList;
                _filter   = filter;

#if MOCKUP
                _hasMoreItems = false;
#endif

                _ = LoadMoreItemsAsync(0);
            }
Пример #2
0
 public void SetFilter(IChatFilter filter)
 {
     Items = new ItemsCollection(ProtoService, Aggregator, this, _chatList, filter);
     RaisePropertyChanged(() => Items);
 }
Пример #3
0
        public ChatsViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator, INotificationsService notificationsService, ChatList chatList, IChatFilter filter = null)
            : base(protoService, cacheService, settingsService, aggregator)
        {
            _notificationsService = notificationsService;

            _chatList = chatList;

            Items = new ItemsCollection(protoService, aggregator, this, chatList, filter);

            ChatPinCommand     = new RelayCommand <Chat>(ChatPinExecute);
            ChatArchiveCommand = new RelayCommand <Chat>(ChatArchiveExecute);
            ChatMarkCommand    = new RelayCommand <Chat>(ChatMarkExecute);
            ChatNotifyCommand  = new RelayCommand <Chat>(ChatNotifyExecute);
            ChatDeleteCommand  = new RelayCommand <Chat>(ChatDeleteExecute);
            ChatClearCommand   = new RelayCommand <Chat>(ChatClearExecute);
            ChatSelectCommand  = new RelayCommand <Chat>(ChatSelectExecute);

            ChatsMarkCommand    = new RelayCommand(ChatsMarkExecute);
            ChatsNotifyCommand  = new RelayCommand(ChatsNotifyExecute);
            ChatsArchiveCommand = new RelayCommand(ChatsArchiveExecute);
            ChatsDeleteCommand  = new RelayCommand(ChatsDeleteExecute);
            ChatsClearCommand   = new RelayCommand(ChatsClearExecute);

            ClearRecentChatsCommand = new RelayCommand(ClearRecentChatsExecute);

            TopChatDeleteCommand = new RelayCommand <Chat>(TopChatDeleteExecute);

#if MOCKUP
            Items.AddRange(protoService.GetChats(20));
#endif

            SelectedItems = new MvxObservableCollection <Chat>();
        }