public ApiFactory(IApiChannels apiChannels, IApiMonths apiMonths, IApiDays apiDays, IApiLogs apiLogs, IApiUserlogs apiUserlogs, IApiMentions apiMentions) { _apiChannels = apiChannels; _apiMonths = apiMonths; _apiDays = apiDays; _apiLogs = apiLogs; _apiUserlogs = apiUserlogs; _apiMentions = apiMentions; }
public ChannelsViewModel(IApiChannels channels, CurrentState currentState) { RefreshChannelCommand = new ActionCommand(async() => await GetChannels()); SwitchToMonthCommand = new ActionCommand(c => _currentState.SwitchViewToMonth((ChannelModel)c)); _channels = channels; _currentState = currentState; if (_currentState.Channels == null) { ChannelList = new ObservableCollection <ChannelModel>(); GetChannels().ConfigureAwait(false); return; } ChannelList = new ObservableCollection <ChannelModel>(_currentState.Channels); }
public MentionsViewModel(IApiChannels apiChannels, IApiMentions apiMentions, CurrentState currentState) { _apiChannels = apiChannels; _apiMentions = apiMentions; _currentState = currentState; SubmitCommand = new ActionCommand(async() => await GetMessages()); SelectedDate = DateTime.Now; if (_currentState.Channels == null) { Channels = new ObservableCollection <string>(); GetChannel().ConfigureAwait(false); return; } Channels = new ObservableCollection <string>(); _currentState.Channels.ForEach(c => Channels.Add(c.Name)); }
public StalkSingleViewModel(IApiLogs apiLogs, IApiChannels apiChannels, CurrentState currentState) { _apiLogs = apiLogs; _apiChannels = apiChannels; _currentState = currentState; SubmitCommand = new ActionCommand(async() => await GetMessages()); NextMonthCommand = new ActionCommand(NextMonth); PrevMonthCommand = new ActionCommand(PrevMonth); GetLogCommand = new ActionCommand(async l => await GetLog((MessageModel)l)); if (_currentState.Channels == null) { Channels = new ObservableCollection <string>(); GetChannel().ConfigureAwait(false); return; } Channels = new ObservableCollection <string>(); _currentState.Channels.ForEach(c => Channels.Add(c.Name)); }
public StalkMultiViewModel(IApiLogs apiLogs, IApiChannels apiChannels, CurrentState currentState) { _apiLogs = apiLogs; _apiChannels = apiChannels; _currentState = currentState; AddUserCommand = new ActionCommand(async() => await AddUser()); RemoveUserCommand = new ActionCommand(u => RenoveUser((MultiViewUserModel)u)); GetLogCommand = new ActionCommand(async l => { var user = (MultiViewUserModel)l; await GetLog(user.SelectedMonth, user.SearchText); }); Users = new ObservableCollection <IMultiViewUserModel>(); LoadUsers(); if (_currentState.Channels == null) { Channels = new ObservableCollection <string>(); GetChannel().ConfigureAwait(false); return; } Channels = new ObservableCollection <string>(); _currentState.Channels.ForEach(c => Channels.Add(c.Name)); }