title: WPF: Command Is Disabled
body: <p>I have a WPF usercontrol, which contains a toolbar with 5 buttons. The commands for for of the buttons is handled in the parent Window, but the fifth button's command is handled by the UC itself. It seems no matter what I try, the button is always disabled. This is my code:</p>
  
  <p>In the user control...</p>
  
  <pre><code>&lt;UserControl.CommandBindings&gt;
  &lt;CommandBinding Command="loc:MyAppCommands.OpenUrl" Executed="OpenUrl" /&gt;
  &lt;/UserControl.CommandBindings&gt;
  </code></pre>
  
  <p>The button in question...</p>
  
  <pre><code>&lt;l49ui:ImageButton Command="loc:MyAppCommands.OpenUrl" CommandParameter="{Binding}" Text="{lex:LocText MyApp.Core:Strings:OpenUrl}"  ShowText="False" ToolTip="{lex:LocText MyApp.Core:Strings:OpenUrl}" Style="{StaticResource ToolBarButton}" 
             Image="{Binding Url,Converter={StaticResource UrlNotNullConverter},ConverterParameter=image}" IsEnabled="true" /&gt; 
  </code></pre>
  
  <p>The datacoontext for the user control is set based on a list selection; so I have WIndow->UserControl tied to ListBox->TabControl->Toolbar buttons</p>
  
  <p>The image changes based on whether the commandparameter (Url in this case) is empty, and this works. However, the button is always disabled. The only thing which causes it to enable is switching to another tab in a pareent tab control, then back to to tab with the button.</p>
  
  <p>I've tried calling CommandManager.InvalidateRequerySuggested(); when the datacontext changes and adding a "CanAlwaysExecute" handler for the command, but the CanExecute handler isn't executed when I call CommandManager.InvalidateRequerySuggested();.</p>