コード例 #1
0
 public void NavigateToMainView(MainViewModel.SubView? subView)
 {
     Navigate("AuctionView", typeof(AuctionView)); // First return to the Auction view, if we pushed from that to another view
     if (subView.HasValue) // Then select the specified tab, if any
     {
         int tabIndex = (int)subView.Value;
         if (MainNavigationContext.SelectedIndex != tabIndex) MainNavigationContext.SelectedIndex = tabIndex;
     }
 }
コード例 #2
0
 public void ContinueToMain(MainViewModel.SubView? subView = null)
 {
     if (MainViewModel == null) MainViewModel = new MainViewModel();
     if (subView.HasValue)
     {
         switch (subView.Value)
         {
             case MainViewModel.SubView.Auction: if (AuctionViewModel == null) AuctionViewModel = new AuctionViewModelDesign(); break;
             case MainViewModel.SubView.Products: if (ProductsViewModel == null) ProductsViewModel = new ProductsViewModelDesign(); break;
         }
     }
     RunOnUIThread(() => _navigator.NavigateToMainView(subView));
 }
コード例 #3
0
        /* TODO: For each viewmodel, add a public property with a private setter like this:
        public _VIEWNAME_ViewModel _VIEWNAME_ViewModel { get; private set; }
         * Note that the New-View and New-ViewModel commands add the above code automatically (see http://github.com/MacawNL/MvvmQuickCross#new-viewmodel). */

        public void ContinueToMain(MainViewModel.SubView? subView = null, bool skipNavigation = false)
        {
            if (MainViewModel == null) MainViewModel = new MainViewModel();
            if (subView.HasValue)
            {
                switch (subView.Value)
                {
                    case MainViewModel.SubView.Auction: if (AuctionViewModel == null) AuctionViewModel = new AuctionViewModelDesign(); break;
                    case MainViewModel.SubView.Products: if (ProductsViewModel == null) ProductsViewModel = new ProductsViewModelDesign(); break;
                }
            }
            if (!skipNavigation) RunOnUIThread(() => _navigator.NavigateToMainView(CurrentNavigationContext, subView));
        }
コード例 #4
0
 public void NavigateToMainView(object navigationContext, MainViewModel.SubView? subView)
 {
     if (subView.HasValue) MainView.CurrentSubView = subView.Value;
     Navigate(navigationContext, typeof(MainView));
 }
コード例 #5
0
 public void NavigateToMainView(MainViewModel.SubView? subView)
 {
     if (subView.HasValue) MainView.CurrentSubView = subView.Value;
     Navigate(typeof(MainView));
 }