From 9c8fc9883337e53be320437b388a5d32549c9a31 Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Wed, 18 Jan 2012 02:52:31 +0000 Subject: [PATCH] DropDownButton: fixed issue with initial command not calling CanExecute to check the state of the buttons --- .../Implementation/DropDownButton.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DropDownButton/Implementation/DropDownButton.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DropDownButton/Implementation/DropDownButton.cs index 344b8e41..32cf8779 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DropDownButton/Implementation/DropDownButton.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DropDownButton/Implementation/DropDownButton.cs @@ -153,6 +153,15 @@ namespace Microsoft.Windows.Controls } void CanExecuteChanged(object sender, EventArgs e) + { + CanExecuteChanged(); + } + + #endregion //Event Handlers + + #region Methods + + private void CanExecuteChanged() { if (Command != null) { @@ -167,10 +176,6 @@ namespace Microsoft.Windows.Controls } } - #endregion //Event Handlers - - #region Methods - /// /// Closes the drop down. /// @@ -267,6 +272,8 @@ namespace Microsoft.Windows.Controls UnhookCommand(oldValue, newValue); HookUpCommand(oldValue, newValue); + + CanExecuteChanged(); //may need to call this when changing the command parameter or target. } #endregion //Command