예제 #1
0
        /// <summary>
        /// Handles changes to the StateMachine property.
        /// </summary>
        private static void OnStateMachineChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Mapping target = (Mapping)d;
            IReactiveStateMachine oldStateMachine = (IReactiveStateMachine)e.OldValue;
            IReactiveStateMachine newStateMachine = target.StateMachine;

            target.OnStateMachineChanged(oldStateMachine, newStateMachine);
        }
        internal void AddMapping(String groupName, IReactiveStateMachine stateMachine)
        {
            if (String.IsNullOrEmpty(groupName))
            {
                throw new ArgumentNullException("groupName");
            }

            if (stateMachine == null)
            {
                throw new ArgumentNullException("stateMachine");
            }

            _mappings.Add(groupName, stateMachine);
            stateMachine.AssociatedVisualStateManager = this;
        }
예제 #3
0
 /// <summary>
 /// Provides derived classes an opportunity to handle changes to the StateMachine property.
 /// </summary>
 protected virtual void OnStateMachineChanged(IReactiveStateMachine oldStateMachine, IReactiveStateMachine newStateMachine)
 {
     OnStateMachineChanged(EventArgs.Empty);
 }