コード例 #1
0
ファイル: EventsViewModel.cs プロジェクト: banjoh/noppawp8
        public EventsViewModel(INavigationController navigationController)
        {
            Title = AppResources.EventsTitle;

            EventActivatedCommand = ControllerUtil.MakeShowCourseEventCommand(navigationController);
            Index = 8;
        }
コード例 #2
0
 public EditContactPageViewModel(IMainPage mainPage, INavigationController navigationController,
                                 IContactService contactService, INotificationService notificationService,
                                 ContactModel model) : base(
         mainPage, navigationController, contactService, notificationService)
 {
     Contact = model;
 }
コード例 #3
0
        /// <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;
            }
        }
コード例 #4
0
 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);
 }
コード例 #5
0
ファイル: SettingsViewModel.cs プロジェクト: schwarzr/Samples
        public SettingsViewModel(IOptionsMonitor <AppOptions> monitor, INavigationController controller)
        {
            _monitor      = monitor;
            _controller   = controller;
            _subscription = _monitor.OnChange(p => _options = p);
            _options      = _monitor.CurrentValue;

            SaveCommand = new DelegateCommand(Save);
        }
コード例 #6
0
    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));
    }
コード例 #7
0
ファイル: LoginViewModel.cs プロジェクト: sTodorov/bugmine
        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());
        }
コード例 #8
0
ファイル: VScene.cs プロジェクト: AnhaytAnanun/MetaNavigation
    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);
    }
コード例 #9
0
ファイル: LoginViewModel.cs プロジェクト: sTodorov/bugmine
        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());
        }
コード例 #10
0
ファイル: AppManager.cs プロジェクト: piess105/Tasker2
 public AppManager(
     IMainPageHelper mainPageHelper,
     INavigationController navigationController,
     IWorkspaceController workspaceController,
     IUIManager <TPage> uIManager)
 {
     MainPageHelper       = mainPageHelper;
     NavigationController = navigationController;
     WorkspaceController  = workspaceController;
     UIManager            = uIManager;
 }
コード例 #11
0
        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);
        }
コード例 #12
0
 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);
 }
コード例 #13
0
    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);
    }
コード例 #14
0
ファイル: EventViewModel.cs プロジェクト: banjoh/noppawp8
        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);
        }
コード例 #15
0
 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();
 }
コード例 #16
0
    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);
    }
コード例 #17
0
        // 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;
        }
コード例 #18
0
ファイル: MenuViewModel.cs プロジェクト: schwarzr/Samples
        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;
        }
コード例 #19
0
    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);
        }
    }
コード例 #20
0
    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));
    }
コード例 #21
0
    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);
        }
    }
コード例 #22
0
        // 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;
        }
コード例 #23
0
        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));
        }
コード例 #24
0
ファイル: ControllerUtil.cs プロジェクト: banjoh/noppawp8
 public static DelegateCommand MakeShowCourseSearchCommand(INavigationController controller)
 {
     return new DelegateCommand(controller.ShowCourseSearch);
 }
コード例 #25
0
ファイル: NavigationService.cs プロジェクト: MartyIX/SoTh
 public static void AttachNavigator(INavigationController controller)
 {
     instance = controller;
 }
コード例 #26
0
 public static void SetNavigation(BindableObject view, INavigationController value)
 {
     view.SetValue(NavigationProperty, value);
 }
コード例 #27
0
 public NavigationViewModel(INavigationController controller, IWebHybrid webHybrid)
 {
     this.controller = controller;
     this.webHybrid = webHybrid;
 }
コード例 #28
0
 public object ResolveToView(INavigationController controller)
 {
     return(restoreStackInfo.View);
 }
コード例 #29
0
 public MainWindowViewModel(INavigationController navigationController, IMainPage mainPage)
 {
     NavigationController             = navigationController;
     navigationController.CurrentPage = (Page)mainPage;
 }
コード例 #30
0
 public NoSourceMainViewModel(IWindowManager windowManager, INavigationController navigationController)
 {
     _windowManager        = windowManager;
     _navigationController = navigationController;
 }
コード例 #31
0
ファイル: CourseViewModel.cs プロジェクト: banjoh/noppawp8
        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;
        }
コード例 #32
0
        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);
        }
コード例 #33
0
ファイル: ControllerUtil.cs プロジェクト: banjoh/noppawp8
 public static DelegateCommand<CourseNewsViewModel> MakeShowCourseNewsCommand(INavigationController controller)
 {
     return new DelegateCommand<CourseNewsViewModel>(controller.ShowCourseNews, news => news != null);
 }
コード例 #34
0
ファイル: ControllerUtil.cs プロジェクト: banjoh/noppawp8
 public static DelegateCommand<CourseEvent> MakeShowCourseEventCommand(INavigationController controller)
 {
     return new DelegateCommand<CourseEvent>(controller.ShowCourseEvent, ev => ev != null);
 }
コード例 #35
0
    public StrategyResult Initialize(INavigationController controller)
    {
        descriptor = controller.ViewMapper.FindDescriptor(id);

        return(new StrategyResult(id, NavigationAttributes.Stacked));
    }
コード例 #36
0
 public void SetNavigationController(INavigationController navigationController)
 {
     this.navigationController = navigationController;
 }
コード例 #37
0
 public object ResolveToView(INavigationController controller)
 {
     return(controller.CreateView(descriptor.Type));
 }
コード例 #38
0
ファイル: EventViewModel.cs プロジェクト: banjoh/noppawp8
 private async void LoadCourseDataAsync(INavigationController controller)
 {
     Course = await NoppaAPI.GetCourse(CourseId);
     CourseName = Course.LongName;
     PageTitle = AppResources.ApplicationTitle.ToUpper() + " " + Course.Id.ToUpper();
 }
コード例 #39
0
ファイル: ControllerUtil.cs プロジェクト: banjoh/noppawp8
 public static DelegateCommand<DepartmentProxy> MakeShowDepartmentCommand(INavigationController controller)
 {
     return new DelegateCommand<DepartmentProxy>(controller.ShowDepartment, dept => dept != null);
 }
コード例 #40
0
 protected override void OnInitialNavigation(LaunchActivatedEventArgs args, INavigationController navigation)
 {
     navigation.Navigate(typeof(MainPage));
 }
コード例 #41
0
ファイル: ControllerUtil.cs プロジェクト: banjoh/noppawp8
 public static DelegateCommand MakeShowHomeCommand(INavigationController controller)
 {
     return new DelegateCommand(controller.ShowHome);
 }
コード例 #42
0
 public NavigationFlowController(INavigationController navigationController)
 {
     _navigationController = navigationController;
 }
コード例 #43
0
ファイル: ControllerUtil.cs プロジェクト: banjoh/noppawp8
 public static DelegateCommand MakeShowSettingsCommand(INavigationController controller)
 {
     return new DelegateCommand(controller.ShowSettings);
 }
コード例 #44
0
ファイル: AppController.cs プロジェクト: dzstoever/ZenFacades
 public static void AttachNavigator(INavigationController navigator)
 {
     if (navigator == null)
         throw new ArgumentNullException("navigator", "You must provide an INavigationController implementation.");
     _navigator = navigator;
 }
コード例 #45
0
 public NavigationViewModel(INavigationController controller, IWebHybrid webHybrid)
 {
     this.controller = controller;
     this.webHybrid  = webHybrid;
 }
コード例 #46
0
 protected NavigatorViewModel(INavigationController navigator)
 {
     this.Navigator = navigator;
 }
コード例 #47
0
ファイル: ControllerUtil.cs プロジェクト: banjoh/noppawp8
 public static DelegateCommand<Course> MakeShowCourseCommand(INavigationController controller)
 {
     return new DelegateCommand<Course>(controller.ShowCourse, course => course != null);
 }