Beispiel #1
0
        private void CustomStatePropertyIsEnabled(object sender, StatePropertyEventArgs e)
        {
            var canExecuteAllTransitions = e.StateMachine.CanExecuteAllTransitions();

            if (canExecuteAllTransitions)
            {
                e.Handled = true;
                e.Enable  = e.Handled;
            }
        }
        private bool IsStatePropertyEnabled(IStateMachine machine)
        {
            var baseObject = machine as XPBaseObject;

            if (baseObject != null)
            {
                var eventArgs = new StatePropertyEventArgs(machine);
                OnCustomStatePropertyIsEnabled(eventArgs);
                return(eventArgs.Handled ? eventArgs.Enable
                    : true.Equals(baseObject.GetMemberValue(XpandStateMachineModule.EnableFilteredProperty)));
            }
            return(false);
        }
        protected virtual void OnCustomStatePropertyIsEnabled(StatePropertyEventArgs e)
        {
            var handler = CustomStatePropertyIsEnabled;

            handler?.Invoke(this, e);
        }