/// <summary>
        ///     The method that is called when the Executed <see cref="RoutedEvent"/> for the
        ///     <see cref="ICommand"/> associated with this <see cref="DataContextCommandBinding"/>
        ///     should be handled.
        /// </summary>
        /// <param name="sender">The command target on which the command is executing.</param>
        /// <param name="e">The event data.</param>
        protected internal override void OnExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var  target = GetDataContext(sender);
            bool canExecute;

            if (CommandExecutionManager.TryExecuteCommand(target, e.Parameter, true, Executed, CanExecute, out canExecute))
            {
                e.Handled = true;
            }
        }
        void ICommand.Execute(object parameter)
        {
            var target = GetDataContext(this._target);

            if (this._target == null)
            {
                return;
            }
            bool canExecute;

            CommandExecutionManager.TryExecuteCommand(target, parameter, true, Executed, CanExecute, out canExecute);
        }
        bool ICommand.CanExecute(object parameter)
        {
            var target = GetDataContext(this._target);

            if (this._target == null)
            {
                return(false);
            }

            bool canExecute;

            return(CommandExecutionManager.TryExecuteCommand(target, parameter, false, Executed, CanExecute, out canExecute) && canExecute);
        }
        /// <summary>
        ///     The method that is called when the PreviewCanExecute <see cref="RoutedEvent"/> for the
        ///     <see cref="ICommand"/> associated with this <see cref="DataContextCommandBinding"/>
        ///     should be handled.
        /// </summary>
        /// <param name="sender">The command target on which the command is executing.</param>
        /// <param name="e">The event data.</param>
        protected internal override void OnPreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            var  target = GetDataContext(sender);
            bool canExecute;

            if (!CommandExecutionManager.TryExecuteCommand(target, e.Parameter, false,
                                                           PreviewExecuted, PreviewCanExecute, out canExecute))
            {
                return;
            }

            e.CanExecute = canExecute;
            e.Handled    = true;
        }