private async Task SetCurrentModuleAsync(ExplorerItem value) { if (value != null) { if (this.SetField(ref _CurrentModule, value, () => CurrentModule)) { if (value.CurrentFormName == this.RootModule.CurrentFormName) { await this.OnStepAsync(EnumSteps.Start); } else if (value.IsExecutable) { await this.OnStepAsync(EnumSteps.ExecuteModule); } } } }
public override async Task OnStepAsync(object stepName) { var step = (EnumSteps)Enum.Parse(typeof(EnumSteps), stepName.ToString()); switch (step) { case EnumSteps.Start: this.ModuleStoryboard.Stop(); this.LandingStoryboard.Stop(); if (Thread.CurrentPrincipal.Identity.IsAuthenticated) { this.IsNavigationVisible = true; this.CurrentModule = this.RootModule; this.LandingStoryboard.Begin(); } else { throw new System.Security.Authentication.AuthenticationException("Current User is not authenticated."); } break; case EnumSteps.HoverModule: break; case EnumSteps.ExecuteModule: if (CurrentModule.IsExecutable) { if (this.CurrentModule.CurrentFormName == Forms.Receipting) { this.IsNavigationVisible = false; } this.LandingStoryboard.Stop(); this.ModuleStoryboard.Begin(); if (this.OnNewModule != null) { this.OnNewModule(this.CurrentModule.CurrentFormName, this.CurrentModule.CurrentViewModel, this.CurrentModule.CanEdit); } } break; } }
private void RaiseItemClickEvent(ExplorerItem item) { item.EventClickedItem -= item_EventClickedItem; item.EventClickedItem += item_EventClickedItem; if (item.Children != null && item.Children.Count > 0) { foreach (ExplorerItem child in item.Children) { RaiseItemClickEvent(child); } } }
protected override async Task NavigateToFormAsync(Forms form, ViewModelUseCaseBase viewModel) { this.DisposeResource(); var item = this.CurrentModule.Children.FirstOrDefault(m => m.CurrentFormName == form); item.CurrentViewModel = viewModel; this.CurrentModule = item; }