private WindowItem <Model.Policy> CreateNewWindow(Model.Policy policy) { var bootStrapper = new PolicyShellBootStrapper(compositionContainer, policy); bootStrapper.Run(); RegisterPolicyContextState(policy); var windowItem = this.windowService.CreateWindow(policy, bootStrapper.Shell); GetMainRegion().Add(windowItem.CurrentView); return(windowItem); }
public PolicyShellBootStrapper(CompositionContainer parentContainer, Model.Policy policy) { if (parentContainer == null) { throw new ArgumentNullException("parentContainer"); } if (policy == null) { throw new ArgumentNullException("policy"); } this.ParentContainer = parentContainer; this.Policy = policy; }
public void OpenPolicyWindow(Model.Policy policy) { IRegion mainRegion = GetMainRegion(); if (mainRegion == null) { return; } WindowItem <Model.Policy> windowItem; if (!this.windowService.ContainsWindow(policy)) { if (stateService.ExistsContextState(policy.PolicyId.ToString())) { var confirmMessage = string.Format("We have found saved work for Policy: {0}, would you like to continue with this work?", policy.PolicyId); messageBoxService.ShowConfirm( confirmMessage, () => { windowItem = CreateNewWindow(policy); OpenWindow(windowItem); }, () => { stateService.RemoveContextState(policy.PolicyId.ToString()); windowItem = CreateNewWindow(policy); OpenWindow(windowItem); }); } else { windowItem = CreateNewWindow(policy); OpenWindow(windowItem); } } else { windowItem = this.windowService.GetWindow(policy); OpenWindow(windowItem); } }
public void OpenPolicy(Policy.Contracts.Models.Policy policy) { this.eventAggregator.GetEvent <PolicySearchSelectedEvent>().Publish(policy); }
public void OpenPolicyWindow(Policy.Contracts.Models.Policy policy) { this.policyWindowService.OpenPolicyWindow(policy); }
public void CloseWindow(Model.Policy policy) { var policyWindowItem = this.windowService.GetWindow(policy); CloseWindow(policyWindowItem); }
private void RegisterPolicyContextState(Model.Policy policy) { this.stateService.RegisterContextState(policy.PolicyId.ToString(), "Policy:" + policy.PolicyId, null); }