protected override void OnInitialize() { base.OnInitialize(); feedManager = new FeedManager(); selectionService = Container.GetExport<SelectionService>(); controller = Container.GetExport<NewsFeedsController>(); controller.FeedManager = feedManager; // Wait for Run to udate the first Feed controller.Run(); Context.WaitFor(() => feedManager.Feeds.Single().Items.Count == 3, TimeSpan.FromSeconds(1)); }
public NewsFeedsController(IResourceService resourceService, IAppService appService, ILauncherService launcherService, IMessageService messageService, ISyndicationService syndicationService, SelectionService selectionService, Lazy<FeedListViewModel> feedListViewModel) { this.resourceService = resourceService; this.appService = appService; this.launcherService = launcherService; this.messageService = messageService; this.selectionService = selectionService; this.feedListViewModel = feedListViewModel; this.client = syndicationService.CreateClient(); this.addNewFeedCommand = new AsyncDelegateCommand(AddNewFeed); this.removeFeedCommand = new AsyncDelegateCommand(RemoveFeedAsync, CanRemoveFeed); this.refreshFeedCommand = new AsyncDelegateCommand(RefreshFeed, CanRefreshFeed); this.readUnreadCommand = new DelegateCommand(MarkAsReadUnread, CanMarkAsReadUnread); this.launchWebBrowserCommand = new AsyncDelegateCommand(LaunchWebBrowser, CanLaunchWebBrowser); this.selectionService.PropertyChanged += SelectionServicePropertyChanged; }
public AppController(ILauncherService launcherService, IAppInfoService appInfoService, SelectionService selectionService, Lazy<DataController> dataController, Lazy<AccountController> accountController, Lazy<NewsFeedsController> newsFeedsController, Lazy<SettingsController> settingsController, Lazy<ShellViewModel> shellViewModel, Lazy<FeedListViewModel> feedListViewModel, Lazy<FeedItemListViewModel> feedItemListViewModel, Lazy<FeedItemViewModel> feedItemViewModel) { this.launcherService = launcherService; this.appInfoService = appInfoService; this.selectionService = selectionService; this.dataController = dataController; this.accountController = accountController; this.newsFeedsController = newsFeedsController; this.settingsController = settingsController; this.shellViewModel = shellViewModel; this.feedListViewModel = new Lazy<FeedListViewModel>(() => InitializeFeedListViewModel(feedListViewModel)); this.feedItemListViewModel = new Lazy<FeedItemListViewModel>(() => InitializeFeedItemListViewModel(feedItemListViewModel)); this.feedItemViewModel = new Lazy<FeedItemViewModel>(() => InitializeFeedItemViewModel(feedItemViewModel)); this.navigateBackCommand = new DelegateCommand(NavigateBack, CanNavigateBack); this.showFeedListViewCommand = new DelegateCommand(() => SelectedNavigationItem = NavigationItem.FeedList); this.showFeedItemListViewCommand = new DelegateCommand(ShowFeedItemListView); this.showFeedItemViewCommand = new DelegateCommand(ShowFeedItemView); this.showReviewViewCommand = new AsyncDelegateCommand(ShowReviewView); this.showSettingsViewCommand = new DelegateCommand(ShowSettingsView); this.navigationStack = new Stack<NavigationItem>(); }