public ControllerFactory(ISettingsController settingsController, ITweetObserver tweetObserver, IRaidsController raidsController, IRaidlistController raidlistController, IBlacklistController blacklistController) { GetSettingsController = settingsController; GetTweetObserver = tweetObserver; GetRaidsController = raidsController; GetRaidlistController = raidlistController; GetBlacklistController = blacklistController; GetSettingsController.Load(); GetRaidsController.Load(); GetBlacklistController.Load(); GetRaidlistController.Load(); }
public MainViewModel(IControllerFactory controllerFactory, ITwitterAuthenticator twitterAuthenticator, IGlobalVariables globalVariables, SettingsViewModel settingsViewModel) { GlobalVariables = globalVariables; _raidsController = controllerFactory.GetRaidsController; _tweetObserver = controllerFactory.GetTweetObserver; var settingsController = controllerFactory.GetSettingsController; _blacklistController = controllerFactory.GetBlacklistController; _controllerFactory = controllerFactory; _twitterAuthenticator = twitterAuthenticator; Follows = _raidsController.Follows; SettingsDataContext = settingsViewModel; RaidListCtx = new RaidListViewModel(controllerFactory); RaidBosses = new ReadOnlyObservableCollection <RaidListItem>( controllerFactory.GetRaidlistController.RaidBossListItems); Settings = settingsController.Settings; RemoveCommand = new ActionCommand(r => Remove((string)r)); StartLoginCommand = new ActionCommand(async() => await Startup()); AddNewRaidCommand = new ActionCommand(async() => await DialogHost.Show(new AddRaidDialog(controllerFactory .GetRaidlistController.RaidBossListItems))); ChangeViewCommand = new ActionCommand(i => ChangeView((string)i)); _tweetObserver.SetAddAction(AddTweet); CheckUpdate(); Id = UniqueId.Create(); if (settingsController.Settings.Autologin && !string.IsNullOrWhiteSpace(settingsController.Settings.AccessToken) && !string.IsNullOrWhiteSpace(settingsController.Settings.AccessTokenSecret)) { Startup().ConfigureAwait(false); } //Console.WriteLine(new List<string>()[4]); }