public override bool ChangePresentation(IPresentationChange presentationChange) { var rootViewController = Window.RootViewController; if (rootViewController is MainTabBarController mainTabBarController) { switch (presentationChange) { case ShowReportsPresentationChange showReportsPresentationChange: mainTabBarController.SelectedIndex = 1; var navigationController = mainTabBarController.SelectedViewController as UINavigationController; var reportsViewController = navigationController.ViewControllers.First() as ReportsViewController; var reportsViewModel = reportsViewController.ViewModel; var startDate = showReportsPresentationChange.StartDate; var endDate = showReportsPresentationChange.EndDate; var period = showReportsPresentationChange.Period; var workspaceId = showReportsPresentationChange.WorkspaceId; if (startDate.HasValue && endDate.HasValue) { reportsViewModel.LoadReport(workspaceId, startDate.Value, endDate.Value, ReportsSource.Other); } else if (period.HasValue) { reportsViewModel.LoadReport(workspaceId, period.Value); } return(true); case ShowCalendarPresentationChange _: mainTabBarController.SelectedIndex = 2; return(true); } } return(false); }
public virtual bool ChangePresentation(IPresentationChange presentationChange) => false;
public bool ChangePresentation(IPresentationChange presentationChange) => presenters .Select(presenter => presenter.ChangePresentation(presentationChange)) .Aggregate(CommonFunctions.Or);