예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InputBinding"/> class.
        /// </summary>
        /// <param name="command">The command associated with the specified gesture.</param>
        /// <param name="gesture">The gesture associated with the specified command.</param>
        public InputBinding(ICommand command, InputGesture gesture)
        {
            Contract.Require(command, nameof(command));
            Contract.Require(gesture, nameof(gesture));

            this.Command = command;
            this.gesture = gesture;
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConditionalGesture"/> class.
        /// </summary>
        /// <param name="condition">The condition which must be satisfied in order for the gesture to be valid.</param>
        /// <param name="wrappedGesture">The gesture which is wrapped within this conditional gesture.</param>
        public ConditionalGesture(Func <Object, Boolean> condition, InputGesture wrappedGesture)
        {
            Contract.Require(condition, nameof(condition));
            Contract.Require(wrappedGesture, nameof(wrappedGesture));

            this.condition      = condition;
            this.WrappedGesture = wrappedGesture;
        }