public EventsViewModel(INavigationController navigationController) { Title = AppResources.EventsTitle; EventActivatedCommand = ControllerUtil.MakeShowCourseEventCommand(navigationController); Index = 8; }
public EditContactPageViewModel(IMainPage mainPage, INavigationController navigationController, IContactService contactService, INotificationService notificationService, ContactModel model) : base( mainPage, navigationController, contactService, notificationService) { Contact = model; }
/// <summary> /// Main "Host" for Vndb content screens /// </summary> /// <param name="windowManager"></param> /// <param name="navigationController"></param> public VndbContentViewModel(IWindowManager windowManager, INavigationController navigationController) { try { _windowManager = windowManager; _navigationController = navigationController; var vInfo = new VndbInfoViewModel { DisplayName = App.ResMan.GetString("Main") }; var vChar = new VndbCharactersViewModel { DisplayName = App.ResMan.GetString("Characters") }; var vScreen = new VndbScreensViewModel { DisplayName = App.ResMan.GetString("Screenshots") }; Items.Add(vInfo); Items.Add(vChar); Items.Add(vScreen); } catch (Exception e) { App.Logger.Error(e, "Failed to create VndbContentHost"); SentryHelper.SendException(e, null, SentryLevel.Error); throw; } }
public AreasViewModel(ICurrentProjectService currentProjectService, IAreaService areaController, INavigationController navigation) { this._currentProjectService = currentProjectService; this._areaController = areaController; this._navigation = navigation; _subscription = _currentProjectService.Register(OnProjectChanged); Areas = new ObservableCollection <CommandWrapper>(); CreateIssueCommand = new DelegateCommand <AreaInfo>(CreateIssue); }
public SettingsViewModel(IOptionsMonitor <AppOptions> monitor, INavigationController controller) { _monitor = monitor; _controller = controller; _subscription = _monitor.OnChange(p => _options = p); _options = _monitor.CurrentValue; SaveCommand = new DelegateCommand(Save); }
public StrategyResult Initialize(INavigationController controller) { if ((level < 1) || (level > controller.ViewStack.Count - 1)) { throw new InvalidOperationException($"Pop level is invalid. level=[{level}], stacked=[{controller.ViewStack.Count}]"); } restoreStackInfo = controller.ViewStack[controller.ViewStack.Count - level - 1]; return(new StrategyResult(restoreStackInfo.Descriptor.Id, NavigationAttributes.Restore)); }
public LoginViewModel(IRegionManager regionManager, IUserService userService, INavigationController navigationController) { _regionManager = regionManager; _userService = userService; _navigation = navigationController; _loginCommand = new ReactiveCommand(this.WhenAny(c => c.LoginKey, (key) => !string.IsNullOrEmpty(key.Value))); _loginCommand.Subscribe(_ => Login()); }
public void AttachTo(GameObject parent, INavigationController navigationController) { GameObject.transform.parent = parent.transform; GameObject.transform.localPosition = Vector3.zero; GameObject.transform.localRotation = new Quaternion(0, 0, 0, 0); VSceneController sceneController = GameObject.GetComponent <VSceneController>(); sceneController.SetNavigationController(navigationController); }
public AppManager( IMainPageHelper mainPageHelper, INavigationController navigationController, IWorkspaceController workspaceController, IUIManager <TPage> uIManager) { MainPageHelper = mainPageHelper; NavigationController = navigationController; WorkspaceController = workspaceController; UIManager = uIManager; }
public CreateIssueViewModel(IIssueService controller, INavigationController navigation) { this._service = controller; this._navigation = navigation; IssueTypes = new ObservableCollection <IssueTypeInfo>(); Employees = new ObservableCollection <EmployeeInfo>(); Attachments = new ObservableCollection <byte[]>(); SaveCommand = new DelegateCommand(DoSave); CancelCommand = new DelegateCommand(DoCancel); }
protected ContactPageViewModelBase(IMainPage mainPage, INavigationController navigationController, IContactService contactService, INotificationService notificationService) { MainPage = mainPage; ContactService = contactService; NotificationService = notificationService; NavigationController = navigationController; Contact = new ContactModel { DateOfBirth = DateTime.Today }; SaveCommand = new RelayCommand(SaveBase); ExitCommand = new RelayCommand(Exit); }
public void UpdateStack(INavigationController controller, object toView) { // Activate restored controller.ActivateView(restoreStackInfo.View, restoreStackInfo.RestoreParameter); restoreStackInfo.RestoreParameter = null; // Remove old for (var i = controller.ViewStack.Count - 1; i > controller.ViewStack.Count - level - 1; i--) { controller.CloseView(controller.ViewStack[i].View); } controller.ViewStack.RemoveRange(controller.ViewStack.Count - level, level); }
public EventViewModel(CourseEvent courseEvent, INavigationController controller) { _event = courseEvent; PageTitle = AppResources.ApplicationTitle.ToUpper(); StartDate = courseEvent.StartDate; EndDate = courseEvent.EndDate; _showCourseCommand = new DelegateCommand(() => controller.ShowCourse(Course), () => Course != null); _addToCalendarCommand = new DelegateCommand(AddToCalendar); LoadCourseDataAsync(controller); }
public MainPageViewModel(INavigationController navigationController, INotificationService notificationService, IContactService contactService, IAddContactPage addContactPage) { NotificationService = notificationService; ContactService = contactService; NavigationController = navigationController; AddContactPage = addContactPage; AddContactCommand = new RelayCommand(AddContact); RemoveContactCommand = new RelayCommand(RemoveContact); LoadContactsCommand = new RelayCommand(LoadContacts); EditContactCommand = new RelayCommand(EditContact); Contacts = new ObservableCollection <ContactModel>(); LoadContacts(); }
public void UpdateStack(INavigationController controller, object toView) { // Stack new controller.ViewStack.Add(new ViewStackInfo(descriptor, toView)); controller.OpenView(toView); // Remove old for (var i = controller.ViewStack.Count - 2; i >= controller.ViewStack.Count - level - 2; i--) { controller.CloseView(controller.ViewStack[i].View); } controller.ViewStack.RemoveRange(controller.ViewStack.Count - level - 2, level + 1); }
// Note: we can't remove this constructor, it would be a breaking change protected WizardBase(ITypeFactory typeFactory) { Argument.IsNotNull(() => typeFactory); _typeFactory = typeFactory; _navigationController = _typeFactory.CreateInstanceWithParametersAndAutoCompletion <DefaultNavigationController>(this); ResizeMode = System.Windows.ResizeMode.NoResize; MinSize = new System.Windows.Size(650d, 500d); MaxSize = new System.Windows.Size(650d, 500d); ShowInTaskbar = false; IsHelpVisible = false; CanShowHelp = true; HandleNavigationStates = true; }
public MenuViewModel(INavigationController controller, IProjectService projectController, ICurrentProjectService currentProjectService, IStateViewModel stateViewModel, IOptionsMonitor <AppOptions> monitor) { _subscription = monitor.OnChange(async p => await InitializeAsync()); MenuItems = new ObservableCollection <MenuItem>(); MenuItems.Add(new MenuItem("Areas", new DelegateCommand(() => controller.ShowAsync <AreasViewModel>()))); MenuItems.Add(new MenuItem("Settings", new DelegateCommand(() => controller.ShowAsync <SettingsViewModel>()))); this._navigationController = controller; this._projectService = projectController; this._currentProjectService = currentProjectService; this.StateViewModel = stateViewModel; }
public void UpdateStack(INavigationController controller, object toView) { // Stack new controller.ViewStack.Add(new ViewStackInfo(descriptor, toView)); controller.OpenView(toView); // Deactive old var count = controller.ViewStack.Count; if (count > 1) { var index = count - 2; controller.ViewStack[index].RestoreParameter = controller.DeactivateView(controller.ViewStack[index].View); } }
public StrategyResult Initialize(INavigationController controller) { if (all) { level = controller.ViewStack.Count - 1; } else { if ((level < 1) || (level > controller.ViewStack.Count - 1)) { throw new InvalidOperationException($"Pop level is invalid. level=[{level}], stacked=[{controller.ViewStack.Count}]"); } } descriptor = controller.ViewMapper.FindDescriptor(id); return(new StrategyResult(id, NavigationAttributes.None)); }
public void UpdateStack(INavigationController controller, object toView) { // Stack new controller.ViewStack.Add(new ViewStackInfo(descriptor, toView)); controller.OpenView(toView); // Remove old var count = controller.ViewStack.Count; if (count > 1) { var index = count - 2; controller.CloseView(controller.ViewStack[index].View); controller.ViewStack.RemoveAt(index); } }
// Note: we can't remove this constructor, it would be a breaking change protected WizardBase(ITypeFactory typeFactory) { Argument.IsNotNull(() => typeFactory); _typeFactory = typeFactory; _navigationController = _typeFactory.CreateInstanceWithParametersAndAutoCompletion <DefaultNavigationController>(this); ResizeMode = System.Windows.ResizeMode.NoResize; MinSize = new System.Windows.Size(650d, 500d); MaxSize = new System.Windows.Size(650d, 500d); HorizontalScrollbarVisibility = ScrollBarVisibility.Disabled; VerticalScrollbarVisibility = ScrollBarVisibility.Auto; RestoreScrollPositionPerPage = true; CacheViews = true; ShowInTaskbar = false; IsHelpVisible = false; CanShowHelp = true; HandleNavigationStates = true; AllowQuickNavigation = false; }
public override IEnumerable <CooperativeTaskStatus> DoWork() { string destinationName = SelectDestination.GetDestinationName(Context.LocalKnowledge); if (destinationName != null) { INavigationController navigationController = Context.LocalKnowledge.Get <INavigationController>("NavigationController"); if (navigationController != null) { navigationController.DestinationName = destinationName; while (!navigationController.IsDone) { yield return(Wait()); } yield return(Finished(true)); } else { DebugLog.Error("MoveTo unable to find INavigationController in local knowledge"); } } yield return(Finished(false)); }
public static DelegateCommand MakeShowCourseSearchCommand(INavigationController controller) { return new DelegateCommand(controller.ShowCourseSearch); }
public static void AttachNavigator(INavigationController controller) { instance = controller; }
public static void SetNavigation(BindableObject view, INavigationController value) { view.SetValue(NavigationProperty, value); }
public NavigationViewModel(INavigationController controller, IWebHybrid webHybrid) { this.controller = controller; this.webHybrid = webHybrid; }
public object ResolveToView(INavigationController controller) { return(restoreStackInfo.View); }
public MainWindowViewModel(INavigationController navigationController, IMainPage mainPage) { NavigationController = navigationController; navigationController.CurrentPage = (Page)mainPage; }
public NoSourceMainViewModel(IWindowManager windowManager, INavigationController navigationController) { _windowManager = windowManager; _navigationController = navigationController; }
public async Task LoadContentAsync(INavigationController navigationController) { if (IsLoading) { return; } IsLoading = true; _course = await NoppaAPI.GetCourse(Code); _toggleSecondaryTileCommand.NotifyCanExecuteChanged(); UpdateToggleCommandText(); List<CourseContentViewModel> viewmodels = new List<CourseContentViewModel>() { new LecturesViewModel(), new ExercisesViewModel(), new ResultsViewModel(), new AssignmentsViewModel(), new EventsViewModel(navigationController) }; List<Task<CourseContentViewModel>> tasks = new List<Task<CourseContentViewModel>>(); await Task.WhenAll( /* Load Overview (already in the contents) */ OverviewModel.LoadDataAsync(Code), /* Load News (already in the contents) */ NewsModel.LoadDataAsync(Code) ); foreach (var vm in viewmodels) tasks.Add(vm.LoadDataAsync(Code)); /* Add items in the order they are finished. */ while (tasks.Count > 0) { var task = await Task.WhenAny(tasks); tasks.Remove(task); var content = await task; if (!content.IsEmpty) { int index = _contents.Count; // Find the correct position for (int i = 0; i < _contents.Count; i++) { if (_contents[i].Index > content.Index) { index = i; break; } } _contents.Insert(index, content); NotifyPropertyChanged("Contents"); } } if (OverviewModel.OodiUrl != null) { OodiPageUri = new Uri(OverviewModel.OodiUrl); } IsLoading = false; }
public CourseListViewModel(INavigationController navigationController) { _searchCommand = new DelegateCommand<string>(query => { StopLoading(); _cts = new CancellationTokenSource(); _loaderTask = LoadSearchResultsAsync(query, _cts.Token); }); _courses.CollectionChanged += OnCoursesChanged; ActivateCourseCommand = ControllerUtil.MakeShowCourseCommand(navigationController); }
public static DelegateCommand<CourseNewsViewModel> MakeShowCourseNewsCommand(INavigationController controller) { return new DelegateCommand<CourseNewsViewModel>(controller.ShowCourseNews, news => news != null); }
public static DelegateCommand<CourseEvent> MakeShowCourseEventCommand(INavigationController controller) { return new DelegateCommand<CourseEvent>(controller.ShowCourseEvent, ev => ev != null); }
public StrategyResult Initialize(INavigationController controller) { descriptor = controller.ViewMapper.FindDescriptor(id); return(new StrategyResult(id, NavigationAttributes.Stacked)); }
public void SetNavigationController(INavigationController navigationController) { this.navigationController = navigationController; }
public object ResolveToView(INavigationController controller) { return(controller.CreateView(descriptor.Type)); }
private async void LoadCourseDataAsync(INavigationController controller) { Course = await NoppaAPI.GetCourse(CourseId); CourseName = Course.LongName; PageTitle = AppResources.ApplicationTitle.ToUpper() + " " + Course.Id.ToUpper(); }
public static DelegateCommand<DepartmentProxy> MakeShowDepartmentCommand(INavigationController controller) { return new DelegateCommand<DepartmentProxy>(controller.ShowDepartment, dept => dept != null); }
protected override void OnInitialNavigation(LaunchActivatedEventArgs args, INavigationController navigation) { navigation.Navigate(typeof(MainPage)); }
public static DelegateCommand MakeShowHomeCommand(INavigationController controller) { return new DelegateCommand(controller.ShowHome); }
public NavigationFlowController(INavigationController navigationController) { _navigationController = navigationController; }
public static DelegateCommand MakeShowSettingsCommand(INavigationController controller) { return new DelegateCommand(controller.ShowSettings); }
public static void AttachNavigator(INavigationController navigator) { if (navigator == null) throw new ArgumentNullException("navigator", "You must provide an INavigationController implementation."); _navigator = navigator; }
protected NavigatorViewModel(INavigationController navigator) { this.Navigator = navigator; }
public static DelegateCommand<Course> MakeShowCourseCommand(INavigationController controller) { return new DelegateCommand<Course>(controller.ShowCourse, course => course != null); }