RadBusyIndicator is removing my theme

4 posts, 1 answers
  1. Linus
    Linus avatar
    6 posts
    Member since:
    Oct 2010

    Posted 09 Jan 2012 Link to this post

    I have a view with a couple of regular Silverlight TextBlocks and TextBoxes which are nicely styled using Expression_Dark theme on the application level. But then I wrap a RadBusyIndicator around my controls and the styling goes away.

    Why is this? It does not help to explicitly set the them on the RadBusyIndicator control.

    Thankful for any help.
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 10 Jan 2012 Link to this post

    Hi,

    Application themes take effect on RadControls only. For native MS Silverlight controls like TextBlocks and TextBoxes, you will need to apply the theme explicitly.

    A working sample:
    <telerik:RadBusyIndicator IsBusy="True">
                <Grid Width="300">
                    <TextBlock Text="TextBlock" VerticalAlignment="Center" telerik:StyleManager.Theme="Expression_Dark" />  
                    <TextBox Margin="100 0" Width="100" VerticalAlignment="Center" telerik:StyleManager.Theme="Expression_Dark" />              
                </Grid>         
            </telerik:RadBusyIndicator>

    public MainPage()
            {
                // Required to initialize variables
                  
                StyleManager.ApplicationTheme = new Expression_DarkTheme();
                InitializeComponent();
            }

    Hope this helps.

    Kind regards,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Linus
    Linus avatar
    6 posts
    Member since:
    Oct 2010

    Posted 16 Jan 2012 Link to this post

    Hi!

    Thanks for you reply. Unfortunately it didn't help me and I would very much like to know what I'm doing wrong. Even when explicitly setting the theme on the TextBlock I don't get the correct theme. Or atleast I suppose so.

    In my regular app I have a nice grey background and a light-grey/white color of my TextBlocks (without explicitly setting the theme). In my new Test app I get the result you can see in the attached radthemes.png file. I don't even use RadBusyIndicator which introduced the problem in my regular app. Two things bother me in the test app:

    * The background is white, why not grey? I'm setting the ApplicationTheme to Expression_Dark in the ctor before InitializeComponent().
    * The TextBlocks are both black and there's seemingly no difference between the one with the theme and the one without.

    My page:
    <Grid x:Name="LayoutRoot" >
        <StackPanel>
            <TextBlock Text="TextBlock without theme" HorizontalAlignment="Center" Margin="5 5 5 5"/>
            <TextBlock Text="TextBlock with theme" HorizontalAlignment="Center" telerik:StyleManager.Theme="Expression_Dark" Margin="5 5 5 5"/>
            <TextBox Width="300" Text="TextBox without theme" Margin="5 5 5 5"/>
            <TextBox Width="300" Text="TextBox with theme" Margin="5 5 5 5"
                     telerik:StyleManager.Theme="Expression_Dark"
                     />
            <telerik:RadButton Width="300" Content="RadButton" Margin="5 5 5 5"/>
        </StackPanel>
    </Grid>

  5. Answer
    Dani
    Admin
    Dani avatar
    848 posts

    Posted 17 Jan 2012 Link to this post

    Hi Linus,

    The TextBlock is not a themeable control, meaning we do not provide Styles for it in our themes. So applying a theme to it will not result in changing its appearance. If you need a control displaying text as a caption, I suggest  you try using a Label. The Label is themable via our themes and you will be able to take advantage of the Expression Dark style for it.


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