示例#1
0
        /// <summary>
        /// Navigates to the specified page
        /// </summary>
        /// <param name="page">The page to go to</param>
        /// <param name="viewModel">The view model, if any, to set explicitly to the new page</param>
        public virtual void GoToPage(ApplicationPage page, BaseViewModel viewModel = null)
        {
            // Set the view model
            CurrentPageViewModel = viewModel;

            // Set the current page
            CurrentPage = page;

            OnPropertyChanged(nameof(CurrentPage));
            OnPropertyChanged(nameof(CurrentPageViewModel));

            // Log it
            DI.Logger.Log("Changing application page to:" + page.ToString());
        }
示例#2
0
        /// <summary>
        /// Navigates to the specified page
        /// </summary>
        /// <param name="page">The page to go to</param>
        /// <param name="viewModel">The view model, if any, to set explicitly to the new page</param>
        public void GoToPage(ApplicationPage page, BaseViewModel viewModel = null)
        {
            // Set the view model
            CurrentPageViewModel = viewModel;

            // Set the current page
            CurrentPage = page;

            // Fire property changed events
            OnPropertyChanged(nameof(CurrentPageViewModel));
            OnPropertyChanged(nameof(CurrentPage));

            // Notify listeners
            OnPageChange(page);

            // Log it
            IoCClient.Logger.Log("Changing application page to:" + page.ToString());
        }
示例#3
0
        public void PushPage(ApplicationPage page)
        {
            var p = _pageLocator.GetPage(page.ToString());

            _navigation.PushAsync(p);
        }
示例#4
0
        private static BaseViewModel GetViewModel(ApplicationPage page)
        {
            Type viewModelType = Type.GetType($"R6Stats.{page.ToString()}Model");

            return(Activator.CreateInstance(viewModelType) as BaseViewModel);
        }
示例#5
0
        private static Page GetView(ApplicationPage page)
        {
            Type viewType = Type.GetType($"R6Stats.{page.ToString()}");

            return(Activator.CreateInstance(viewType) as Page);
        }