Setting text in RadBusyIndicator

2 posts, 0 answers
  1. Pascal GUERY
    Pascal GUERY avatar
    38 posts
    Member since:
    Apr 2010

    Posted 30 Oct 2013 Link to this post

    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.
  2. Pascal GUERY
    Pascal GUERY avatar
    38 posts
    Member since:
    Apr 2010

    Posted 30 Oct 2013 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top