示例#1
0
        /// <summary>
        /// Navigates the application to specified page
        /// And sets the initial view model for that page if provided
        /// </summary>
        /// <param name="page">The page to go to</param>
        /// <param name="viewModel">The view model to set initially on page (if provided)</param>
        public void GoToPage(ApplicationPage page, MvxViewModel viewModel = null)
        {
            // Change current page to specified one
            CurrentPage = page;

            // If view model wasnt provided
            if (viewModel == null)
            {
                // Create new one for new page
                viewModel = page.GetViewModel(mViewModelProvider);
            }

            // Change the page on application
            mUIManager.GoToViewModelPage(viewModel);
        }