CommandBinding CanExecute always null
Posted
by developer
on Stack Overflow
See other posts from Stack Overflow
or by developer
Published on 2010-03-26T20:55:13Z
Indexed on
2010/03/26
21:13 UTC
Read the original article
Hit count: 687
Hi All,
I am using CommandBinding to display visibility of a button. Below is my code
<UserControl.CommandBindings>
<CommandBinding Command="{x:Static local:AttendeePanel.LaunchAttEditor}" Executed="LaunchAttEditor_Executed" CanExecute="CanCreateProfile"/>
</UserControl.CommandBindings>
<Button Content="Create Profile" Command="local:LaunchEditor"
CommandParameter="{Binding Profile}" Name="BtnCreate">
My problem is that CanExecute method always gets null as parameter even though I am binding the parameter to Profile. Is there a way I can set Data Context? or is this because the canexecute runs before data load?
© Stack Overflow or respective owner