I have a RadTreeView with a blue background and white text. This is problematic with the default bright yellow highlight colors, which I want to keep. So in I change the color of my elements to Black if the element is selected:
private void radTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
{
// The text we want to change the color of is actually a text element inside a layout element within the
// content of the node, so we need to parse down and find it
StackLayoutElement layout = e.NodeElement.ContentElement.Children[0] as StackLayoutElement;
LightVisualElement element = layout.Children[1] as LightVisualElement;
if (e.Node.Selected)
element.ForeColor = Color.Black;
else
element.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local);
}
That works great. The only problem is I need it to black when it's hot-tracking as well, and I don't know how to tell if a node is currently highlighted from being .
How can I tell if the node his highlighted (hot tracking) but not actually selected?