Browse Source

DropDownButton: fixed issue with initial command not calling CanExecute to check the state of the buttons

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
9c8fc98833
  1. 15
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DropDownButton/Implementation/DropDownButton.cs

15
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DropDownButton/Implementation/DropDownButton.cs

@ -153,6 +153,15 @@ namespace Microsoft.Windows.Controls
} }
void CanExecuteChanged(object sender, EventArgs e) void CanExecuteChanged(object sender, EventArgs e)
{
CanExecuteChanged();
}
#endregion //Event Handlers
#region Methods
private void CanExecuteChanged()
{ {
if (Command != null) if (Command != null)
{ {
@ -167,10 +176,6 @@ namespace Microsoft.Windows.Controls
} }
} }
#endregion //Event Handlers
#region Methods
/// <summary> /// <summary>
/// Closes the drop down. /// Closes the drop down.
/// </summary> /// </summary>
@ -267,6 +272,8 @@ namespace Microsoft.Windows.Controls
UnhookCommand(oldValue, newValue); UnhookCommand(oldValue, newValue);
HookUpCommand(oldValue, newValue); HookUpCommand(oldValue, newValue);
CanExecuteChanged(); //may need to call this when changing the command parameter or target.
} }
#endregion //Command #endregion //Command

Loading…
Cancel
Save