/// <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());
        }
Beispiel #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());
        }
        public void PushPage(ApplicationPage page)
        {
            var p = _pageLocator.GetPage(page.ToString());

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

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

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