Ejemplo n.º 1
0
        //// ===========================================================================================================
        //// Member Variables
        //// ===========================================================================================================

        //// ===========================================================================================================
        //// Constructors
        //// ===========================================================================================================

        public HomePageViewModel(INavigationViewService navigationService)
        {
            Param.VerifyNotNull(navigationService, nameof(navigationService));
            CategoryClick = new RelayCommand <HomePageCategory>(
                category => navigationService.NavigateTo(
                    typeof(CategoryPageViewModel),
                    category.Category.ToString()));
        }
Ejemplo n.º 2
0
        //// ===========================================================================================================
        //// Constructors
        //// ===========================================================================================================

        public TitleBarViewModel(INavigationViewService navigationViewService)
        {
            _navigationViewService = Param.VerifyNotNull(navigationViewService, nameof(navigationViewService));

            _navigationViewService.BackStackDepthChange += OnBackStackDepthChange;

            _backCommand = new RelayCommand(ExecuteBackAction, CanGoBack);
        }
        //// ===========================================================================================================
        //// Constructors
        //// ===========================================================================================================

        public CategoryPageNavigationViewModel(
            INavigationViewService navigationViewService,
            CategoryKind categoryKind,
            string groupName,
            IEnumerable <CategoryPageNavigationItem> settings = null)
        {
            Param.VerifyNotNull(navigationViewService, nameof(navigationViewService));

            CategoryKind = categoryKind;
            GroupName    = Param.VerifyString(groupName, nameof(groupName));
            Settings     = new ReadOnlyCollection <CategoryPageNavigationItem>(settings?.ToList() ?? new List <CategoryPageNavigationItem>());

            IsGrouped       = Settings.Any(vm => vm.HeaderDisplayName != null);
            GroupedSettings = Settings.GroupBy(
                setting => setting.HeaderDisplayName,
                (key, items) => new CategoryPageNavigationGroupedItem(key, items));

            HomeCommand = new RelayCommand(() => navigationViewService.NavigateTo(typeof(HomePageViewModel), null));
        }
Ejemplo n.º 4
0
 public ShellViewModel(INavigationService navigationService, INavigationViewService navigationViewService)
 {
     NavigationService            = navigationService;
     NavigationService.Navigated += OnNavigated;
     NavigationViewService        = navigationViewService;
 }