This question is locked. New answers and comments are not allowed.
Hello,
I need to change the foreground color of RadTreeViewItems with the rest of Metro theme settings for RadTreeView still applied. (I attached a picture to the post).
I have a RadTreeView declaration in Xaml:
<local:CustomTaskTree
x:Class="AnswerPro.Templates.Silverlight.DefaultTaskTelerik.Tool.TaskTree.TaskTree"
xmlns:local="clr-namespace:AnswerPro.Templates.Silverlight.DefaultTaskTelerik.Tool.TaskTree"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
xmlns:Commands="clr-namespace:AnswerPro.Templates.Silverlight.Common.Command;assembly=AnswerPro.Templates.Silverlight"
mc:Ignorable="d"
d:DesignWidth="640" d:DesignHeight="480"
Title="Список задач">
<Grid x:Name="LayoutRoot">
<telerikNavigation:RadTreeView
x:Name="tvTask"
ItemContainerStyle="{StaticResource YotaItemContainerStyle}"
VerticalAlignment="Stretch"
Commands:Commands.CommandEvent="Selected"
Commands:Commands.CommandParameter = "{ Binding ElementName=tvTask, Path=SelectedItem.Tag }"
Commands:Commands.Command = "{ Binding ShowTaskCommand.Command }"
/>
</Grid>
</local:CustomTaskTree>
But TreeViewItems are generated somehow in code-behind so I don't have access to them in xaml :( I tried applying the following ItemContainerStyle to the RadTreeView:
<Style x:Key="YotaItemContainerStyle" TargetType="telerik:RadTreeViewItem">
<Setter Property="Foreground" Value="Red"/>
</Style>
But it didn't work. It seems that metro theme that is declared for the application is somehow overwriting Item property setting that I try to change.
Is there a way to maybe apply some style to the RadTreeView that would change this color and keep the rest of metro theme settings?
I need to change the foreground color of RadTreeViewItems with the rest of Metro theme settings for RadTreeView still applied. (I attached a picture to the post).
I have a RadTreeView declaration in Xaml:
<local:CustomTaskTree
x:Class="AnswerPro.Templates.Silverlight.DefaultTaskTelerik.Tool.TaskTree.TaskTree"
xmlns:local="clr-namespace:AnswerPro.Templates.Silverlight.DefaultTaskTelerik.Tool.TaskTree"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
xmlns:Commands="clr-namespace:AnswerPro.Templates.Silverlight.Common.Command;assembly=AnswerPro.Templates.Silverlight"
mc:Ignorable="d"
d:DesignWidth="640" d:DesignHeight="480"
Title="Список задач">
<Grid x:Name="LayoutRoot">
<telerikNavigation:RadTreeView
x:Name="tvTask"
ItemContainerStyle="{StaticResource YotaItemContainerStyle}"
VerticalAlignment="Stretch"
Commands:Commands.CommandEvent="Selected"
Commands:Commands.CommandParameter = "{ Binding ElementName=tvTask, Path=SelectedItem.Tag }"
Commands:Commands.Command = "{ Binding ShowTaskCommand.Command }"
/>
</Grid>
</local:CustomTaskTree>
But TreeViewItems are generated somehow in code-behind so I don't have access to them in xaml :( I tried applying the following ItemContainerStyle to the RadTreeView:
<Style x:Key="YotaItemContainerStyle" TargetType="telerik:RadTreeViewItem">
<Setter Property="Foreground" Value="Red"/>
</Style>
But it didn't work. It seems that metro theme that is declared for the application is somehow overwriting Item property setting that I try to change.
Is there a way to maybe apply some style to the RadTreeView that would change this color and keep the rest of metro theme settings?