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

Binding IsBusy to DomainContext IsLoading

2 Answers 136 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Stefan Buys
Top achievements
Rank 2
Stefan Buys asked on 22 Feb 2011, 12:48 PM
Hi,
When I bind a RadBusyIndicator's IsBusy property to a (RIA Services) DomainContext's IsLoading property in code, it doesn't fire on the UI.

I am therefor not using a DomainDataSource, but binding like this through code:

NemoDomainContext context = Common.CreateNewNemoContext();
RadBusyIndicator biStartup = new RadBusyIndicator();
 
Binding bindingEnabled = new Binding();
bindingEnabled.Source = context;
bindingEnabled.Path = new PropertyPath("IsLoading");
bindingEnabled.Mode = BindingMode.OneWay;
biStartup.SetBinding(RadBusyIndicator.IsBusyProperty, bindingEnabled);

Any advice / ideas are welcome.

Stefan

2 Answers, 1 is accepted

Sort by
0
Stefan Buys
Top achievements
Rank 2
answered on 23 Feb 2011, 02:25 PM
Hi All,

I managed to find the solution to the problem, its rather sneaky, but ensure that RadBusyIndicator has the correct Content scope:

<telerik:RadBusyIndicator x:Name="biStartup" IsBusy="False" DisplayAfter="0" BusyContent="">
            <telerik:RadBusyIndicator.Content>
                <StackPanel Orientation="Vertical">
                    <ContentControl x:Name="ccRibbon" />
                    <ContentControl x:Name="ccMain" />
                </StackPanel>              
            </telerik:RadBusyIndicator.Content>               
        </telerik:RadBusyIndicator>

Stefan
0
Teodor
Telerik team
answered on 25 Feb 2011, 02:04 PM
Hi Stefan Buys,

Thank you for contacting us.

We are glad, you have found a solution to your issue.

Just for your information, RadBusyIndicator can be prevented from showing busy indication if the UI thread is blocked (for example if the DomainContext blocks it). Therefore it is recommended that long-running operations are executed asynchronously so that the UI remains responsive. This example shows a possible scenario. 

Hope this explains the matter. Let us know in case you have further queries.

Best wishes,
Teodor
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
BusyIndicator
Asked by
Stefan Buys
Top achievements
Rank 2
Answers by
Stefan Buys
Top achievements
Rank 2
Teodor
Telerik team
Share this question
or