I have a toolbar with a button that executes a command. When the command is executed, I set a property from code behind:
SetValue(IsRunningProperty, true);
A worker thread does some work, and when completed the property is updated again:
SetValue(IsRunningProperty, false);
The toolbar binds to this property as follows:
<telerik:RadButton Margin="2" Command="{StaticResource Commands.Run}" IsEnabled="{Binding IsRunning, Converter={StaticResource InverseBooleanConverter}}">
<Image Stretch="None" Source="..." />
</telerik:RadButton>
This works as long as the toolbar is not focused. If I press the button and wait for my worker to complete, the button will remain disabled until I click in my RadDiagram.
Why isn't the toolbar updating immediately?
UPDATE: Ok, it seems this is caused by a call to someOtherWindow.Focus(). Still, why doesn't the toolbar update itself?
SetValue(IsRunningProperty, true);
A worker thread does some work, and when completed the property is updated again:
SetValue(IsRunningProperty, false);
The toolbar binds to this property as follows:
<telerik:RadButton Margin="2" Command="{StaticResource Commands.Run}" IsEnabled="{Binding IsRunning, Converter={StaticResource InverseBooleanConverter}}">
<Image Stretch="None" Source="..." />
</telerik:RadButton>
This works as long as the toolbar is not focused. If I press the button and wait for my worker to complete, the button will remain disabled until I click in my RadDiagram.
Why isn't the toolbar updating immediately?
UPDATE: Ok, it seems this is caused by a call to someOtherWindow.Focus(). Still, why doesn't the toolbar update itself?