protected override void OnFrameAssigned() { base.OnFrameAssigned(); Frame.Disposing += FrameOnDisposing; _logicRuleViewController = Frame.GetController <LogicRuleViewController>(); _logicRuleViewController.LogicRuleExecutor.LogicRuleExecute += OnLogicRuleExecute; }
protected override void OnActivated() { base.OnActivated(); if (LogicRuleManager.HasRules <ControllerStateLogicInstaller>(View.ObjectTypeInfo)) { _logicRuleViewController = Frame.GetController <LogicRuleViewController>(); _logicRuleViewController.LogicRuleExecutor.LogicRuleExecute += LogicRuleViewControllerOnLogicRuleExecute; } }
protected override void OnFrameAssigned() { base.OnFrameAssigned(); _logicRuleViewController = Frame.GetController <LogicRuleViewController>(); if (_logicRuleViewController == null) { throw new NullReferenceException("Use the application designer to drag and drop the AdditionalViewControlsProvider module"); } _logicRuleViewController.LogicRuleExecutor.LogicRuleExecuting += OnLogicRuleExecuting; Frame.Disposing += FrameOnDisposing; }
protected override void OnFrameAssigned() { base.OnFrameAssigned(); _logicRuleViewController = Frame.GetController <LogicRuleViewController>(); Frame.Disposing += FrameOnDisposing; _logicRuleViewController.LogicRuleExecutor.LogicRuleExecute += LogicRuleExecutorOnLogicRuleExecute; if (Frame.Template == Application.MainWindow) { AuditSystemChanges(); } }
protected override void OnFrameAssigned() { base.OnFrameAssigned(); _masterDetailRules = new List <IMasterDetailRule>(); Frame.Disposing += FrameOnDisposing; _logicRuleViewController = Frame.GetController <LogicRuleViewController>(); _logicRuleViewController.LogicRuleExecutor.LogicRuleExecute += LogicRuleViewControllerOnLogicRuleExecute; var masterDetailViewControllerBase = Frame.Controllers.Values.OfType <IMasterDetailViewController>().SingleOrDefault(); if (masterDetailViewControllerBase != null) { masterDetailViewControllerBase.RequestRules = frame1 => { var masterDetailRules = frame1.GetController <MasterDetailRuleController>()._masterDetailRules.DistinctBy(rule => rule.Id); return(masterDetailRules.Select(rule => new MasterDetailRuleInfo(rule.ChildListView, rule.CollectionMember, rule.TypeInfo, null)).ToList()); } } ; } void FrameOnDisposing(object sender, EventArgs eventArgs) { _logicRuleViewController.LogicRuleExecutor.LogicRuleExecute -= LogicRuleViewControllerOnLogicRuleExecute; }