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

Setting text in RadBusyIndicator

1 Answer 396 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Pascal GUERY
Top achievements
Rank 1
Pascal GUERY asked on 30 Oct 2013, 09:27 AM
Hi everyone,

I am developing a WPF application in which I use RadControls.
I have declared an indeterminated RadBusyIndicator control in a Window's markup.
I have to implement 2 methods in the Window's code-behind to respectively show and hide the BusyIndicator.

The show method takes an input parameter corresponding to the message to display in the BusyIndicator.
I have looked at this help page : radbusyindicator-features-custom-busy-content.html
I have read I can define a custom BusyIndicator content by declaring a DataTemplate.

I have though about declaring a DataTemplate containing a TextBlock.
But I do not know how to set the TextBlock's text from the show method.
Can you please describe me a way to do it ?

I have thought about creating a property in the Window's code-behind representing the TextBlock's text.
I could set the Window's property from the show method.
I have also thought about binding the Window's property to the TextBlock's Text property but I do not know how to do it.

Thank you in advance for your future help.

1 Answer, 1 is accepted

Sort by
0
Pascal GUERY
Top achievements
Rank 1
answered on 30 Oct 2013, 10:30 AM
I have solved my issue by looking cautiously at this help page : http://www.telerik.com/help/wpf/radbusyindicator-features-custom-busy-content.html

I have declared a DataTemplate in the Window's template.
The DataTemplate contains a TextBlock.
The TextBlock's DataContext property is binded to the BusyIndicator's DataContext property.
The BusyIndicator's DataContext is the Window's DataContext which is the Window.
The TextBlock's Text property is binded to a Window's property representing the message to display.
The PropertyChanged event is raised when the Window's property is set.
Tags
BusyIndicator
Asked by
Pascal GUERY
Top achievements
Rank 1
Answers by
Pascal GUERY
Top achievements
Rank 1
Share this question
or