This is a migrated thread and some comments may be shown as answers.

IsEnabled not updating?

1 Answer 409 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 10 Apr 2013, 07:55 AM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 10 Apr 2013, 10:27 AM
Hello Kristoffer,

RadToolBar is designed to be a separate focus scope. You can try setting the attached property:

FocusManager.IsFocusScope=False
in XAML and check if all your scenarios work as expected.

All the best,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ToolBar
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or