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

Change Foreground Color

1 Answer 143 Views
BreadCrumb
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tony
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" 
            Grid.Column="2"
            HorizontalAlignment="Right"
            CurrentItemChanged="RadBreadcrumb_CurrentItemChanged"  
            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">
</telerik:RadBreadcrumb>
 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
0
Zarko
Telerik team
answered on 24 Jan 2012, 05:26 PM
Hello,
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:RadBreadcrumb.ItemTemplate>
        <telerik:HierarchicalDataTemplate ItemsSource="{Binding Children}">
            <telerik:HierarchicalDataTemplate.ItemTemplate>
                <DataTemplate>
                    <TextBlock Foreground="Purple" Text="{Binding DisplayText}" />
                </DataTemplate>
            </telerik:HierarchicalDataTemplate.ItemTemplate>
            <TextBlock Foreground="White" Text="{Binding DisplayText}" />
        </telerik:HierarchicalDataTemplate>
    </telerik:RadBreadcrumb.ItemTemplate>
</telerik:RadBreadcrumb>

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,
Zarko
the Telerik team

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

Tags
BreadCrumb
Asked by
Tony
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Share this question
or