protected override Task OnInitialise() { return(Task.Factory .StartNew(() => { var steps = GetSteps(); var index = 0; foreach (var step in steps) { step.Context = Context; step.Ordinal = index; this.SyncViewModelActivationStates(step).AddDisposable(Disposables); this.SyncViewModelBusy(step).AddDisposable(Disposables); _steps.Add(step); index++; } CurrentStep = _steps.First(); GoBackCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); }, Scheduler.Task.TPL)); }
private void GoBackInViewModels() { switch (CheckSize()) { case "Small": if (_thirdColumnVisibility) { FirstColumnVisibility = false; SecondColumnVisibility = true; ThirdColumnVisibility = false; } else { FirstColumnVisibility = true; SecondColumnVisibility = false; } break; case "Medium": FirstColumnVisibility = true; SecondColumnVisibility = true; ThirdColumnVisibility = false; break; } GoBackCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); }
private void PublishIsGameOver(bool isOver) { _isGameOver = isOver; MoveCommand.RaiseCanExecuteChanged(); HintMoveCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); GoBackCommand.RaiseCanExecuteChanged(); IsGameOverEvent_EA_PUB(isOver); }
public void Navigate(Guid pageId) { var page = Module.ChartingPages[pageId]; _mainFrame.Navigate(new Uri(page.Uri, UriKind.RelativeOrAbsolute)); GoBackCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); NavigateToHomeCommand.RaiseCanExecuteChanged(); }
private void OnMainFrameAfterNavigation() { CurrentPage = GetCurrentPage(); GoBackCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); NavigateToHomeCommand.RaiseCanExecuteChanged(); _usageCalculator.UpdateUsage(CurrentPage); }
private void GoBack() { if (!CanGoBack()) { return; } (var region, var journal) = GetMainRegion(); journal.GoBack(); GoBackCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); }
private void MoveHelper(object param, bool isGoBackOrForth, Direction backOrForth) { try { var num = Convert.ToInt32(param); if (MainBoard.IsAllowSwitch(num)) { MainBoard.Switch(num); } else { return; } HintTileProp = -1; if (!isGoBackOrForth) { _isHint = true; if (_breadCrumbsList.Count > _crumb) { _breadCrumbsList.RemoveRange(_crumb, _breadCrumbsList.Count - _crumb); } _breadCrumbsList.Add(num); } switch (backOrForth) { case Direction.BACK: _crumb--; TileClickEvent_EA_PUB(--_moveCnt); break; case Direction.FORTH: _crumb++; TileClickEvent_EA_PUB(++_moveCnt); break; } } catch (Exception) { } if (IsGameOver()) { PublishIsGameOver(true); } else { HintMoveCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); GoBackCommand.RaiseCanExecuteChanged(); MoveCommand.RaiseCanExecuteChanged(); } }
public override void OnNavigatedTo(NavigationContext navigationContext) { InitializeRegionContext(); InitializePrintTemplates(); _navigationContext = navigationContext; _regionManager.RequestNavigate(RegionNames.OrderWizardStageRegion, ViewNames.OrderWizardCustomerView); _regionManager.Regions[RegionNames.OrderWizardStageRegion].NavigationService.Navigated += (s, a) => { Current = a.Uri.ToString(); GoForwardCommand.RaiseCanExecuteChanged(); GoBackwardCommand.RaiseCanExecuteChanged(); }; }
public void GoForward() { var lastExamplePage = CurrentExample as ExampleAppPage; var lastExampleView = _currentExample; _history.Redo(); var example = _history.Current as Example; if (example != null) { Navigate(example); ServiceLocator.Container.Resolve <IModule>().CurrentExample = example; } else { Navigate((Guid)_history.Current); } ServiceLocator.Container.Resolve <ExampleViewModel>().ExportExampleViewModel.IsExportVisible = false; ServiceLocator.Container.Resolve <ExampleViewModel>().BreadCrumbViewModel.IsShowingBreadcrumbNavigation = false; GoBackCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); NavigateToHomeCommand.RaiseCanExecuteChanged(); if (lastExamplePage != null) { // Required to release memory from last example lastExamplePage.ViewModel = null; } if (lastExampleView != null) { lastExampleView.View = null; } GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); }
public void OnNavigatedTo(NavigationContext navigationContext) { _journal = navigationContext.NavigationService.Journal; GoForwardCommand.RaiseCanExecuteChanged(); }
private void UpdateHistoryTransitionStatus() { GoBackwardCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); GoUpCommand.RaiseCanExecuteChanged(); }
public void RequestNavigation(string targetView, NavigationParameters parameters) { _regionManager.RequestNavigate(MainRegionName, targetView, parameters); GoBackCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); }