Closed 42805578 closed 4 years ago
The background is set to transparent with no possible overrides in the default templates.
This is a custom case and you can solve it by implementing your own custom TreeViewItem template that is used in your application. Base it of MaterialDesignTreeViewItem in MaterialDesignTheme.TreeView.xaml and modify to your linking. It’s not 100% clear on what your need is, but I’m guessing you’re interested in changing the background color on the header at line 279.
Another possible solution for you would be use WPF adorners to achieve a similar effect on dragover.
This looks like a simple thing that could be fixed. Simply replacing the hard coded value (as indicated by @stigrune) with a TemplateBinding should fix it (ideally adding a corresponding UI test).
When drag drop a TreeViewItem over another TreeViewItem, I want to change the background color of the target TreeViewItem, in my c# code, I set the background as below: targetTreeViewItem.Background=Colors.Green; but the background not change
Any advice?