Пример #1
0
        protected override void OnDeactivated()
        {
            base.OnDeactivated();
            if (LogicRuleManager.HasActionContextRules(View.ObjectTypeInfo))
            {
                UnsubscribeFromActionEvents();
            }
            if (LogicRuleManager.HasRules(View.ObjectTypeInfo))
            {
                _logicRuleExecutor.Execute(ExecutionContext.ControllerDeActivated, EventArgs.Empty, View);
                View.SelectionChanged            -= ViewOnSelectionChanged;
                View.CurrentObjectChanged        -= ViewOnCurrentObjectChanged;
                View.QueryCanChangeCurrentObject -= ViewOnQueryCanChangeCurrentObject;

                if (ObjectSpace != null)
                {
                    ObjectSpace.ObjectChanged -= ObjectSpaceOnObjectChanged;
                    ObjectSpace.Refreshing    -= ObjectSpace_Refreshing;
                    ObjectSpace.Reloaded      -= ObjectSpace_Reloaded;
                    ObjectSpace.Committed     -= ObjectSpaceOnCommitted;
                }

                Frame.TemplateViewChanged -= FrameOnTemplateViewChanged;
                if (View is ListView)
                {
                    Frame.GetController <ListViewProcessCurrentObjectController>(controller => {
                        controller.CustomProcessSelectedItem   -= OnCustomProcessSelectedItem;
                        controller.CustomizeShowViewParameters -= CustomizeShowViewParameters;
                    });
                }
            }
        }
Пример #2
0
 protected override void OnViewControllersActivated()
 {
     base.OnViewControllersActivated();
     if (LogicRuleManager.HasActionContextRules(View.ObjectTypeInfo))
     {
         SubscribeToActionEvents();
     }
 }