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

Change Foreground Color

1 Answer 123 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Tony asked on 19 Jan 2012, 07:53 PM

How do i change the foreground text color in the RadBreadCrumb? When I set the Foreground property to White (see below), it works fine in the designer. But when I run the application, the breadcrumb text is always black. My Xaml is simple:

<telerik:RadBreadcrumb x:Name="bcCrumbs" VerticalAlignment="Top" 
            Header="{Binding Root}" Width="250" 
            IsIconVisible="False" IsHistoryEnabled="True" IsTextSearchEnabled="False" IsTextModeEnabled="False"  
            ItemsSource="{Binding Root.Children}"
            TextModePath="Path" BorderThickness="0" Foreground="White" Background="Yellow"
            HierarchicalItemsSource="Children" HeaderMemberPath="DisplayText"  HierarchicalMemberPath="DisplayText">
 The only other thing to note is I do set the theme to Metro in the App constructor:
StyleManager.ApplicationTheme = new MetroTheme();

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 24 Jan 2012, 05:26 PM
Thank you for the feedback. There seems to be problem with the foreground property of the RadBreadcrumb.
There are two possible workarounds:
- the first one is to change the default foreground color of the Metro theme like this:
StyleManager.ApplicationTheme = new MetroTheme();
MetroColors.PaletteInstance.MarkerColor = Colors.White;
Note if you do this all metro foregrounds will become white so you'll have to test this.
- and the second one is to use actual ItemTemplate instead of the HierarchicalMemberPath, HeaderMemberPath and HierarchicalItemsSource and set the foreground there like this:
<telerik:RadBreadcrumb x:Name="bcCrumbs"
        <telerik:HierarchicalDataTemplate ItemsSource="{Binding Children}">
                    <TextBlock Foreground="Purple" Text="{Binding DisplayText}" />
            <TextBlock Foreground="White" Text="{Binding DisplayText}" />

I've logged this issue in our PITS  under the name "The Foreground property doesn't work" and it'll be ready for voting and tracking tomorrow the latest. I've also updated your telerik account.
I've attached a sample project that demonstrates the second workaround so could you please examine it and if you have more questions feel free to ask.

All the best,
the Telerik team

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

Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question