BusyIndicator with custom progress that inherits colors from theme

2 posts, 0 answers
  1. Doug
    Doug avatar
    2 posts
    Member since:
    Aug 2011

    Posted 21 Oct 2011 Link to this post

    I've seen the posts on how to edit a style (e.g., http://www.telerik.com/help/silverlight/common-styling-appearance-edit-control-templates-blend.html) and how to modify the progress indicator, but how do I create a RadBusyIndicator with a custom progress indicator (in my case, I want to modify the size and margins), but allow the control to be styled with the selected application theme style (e.g., Expression Dark, Metro, etc.).  When I create the control templates in blend, they generate specific background colors such as:
      <LinearGradientBrush x:Key="BusyIndicatorIndeterminateBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFFC92B" Offset="0"/>
            <GradientStop Color="#FFFFF7A9" Offset="1"/>
            <GradientStop Color="#FFFFFBCD" Offset="0.254"/>
            <GradientStop Color="#FFFFC92B" Offset="0.5"/>

    But I really want the colors to be the themes colors, not the ones generated by blend. I've gotten some success by setting the colors using the TemplatedBinding.
    Example:  <Path x:Name="IndeterminateBackgroundDonut" Fill="{TemplateBinding Background}" ,
    but I still haven't been able to get all the stroke and Fill colors to reflect the colors of the application theme.

    Thanks for any suggestions,
  2. Dani
    Dani avatar
    848 posts

    Posted 24 Oct 2011 Link to this post

    Hi Doug,

    Expression Blend would always generate the default Office Black theme brushes for you. So if you want to use other theme specific brushes, you will have to make that change manually.

    I suggest that you take the default RadProgressBar control template that corresponds to theme you wish to use from the RadControls installation folder/Themes on your machine and apply your customizations on that template. You will get needed template bindings and also theme specific brushes as static resources.

    You can later copy that RadProgressBar in RadBusyIndicator control template.

    I hope this helps.

    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top