-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Bug explanation
Based on #2951, see also PR #2954
I dig myself a bit into the code and came up with two suggestions:
In a normal (non-DataGrid), editable ComboBox's ControlTemplate there is a definition of CaretBrush to be equal to BorderBrush (?). Makes no sense to me, but probably harms nothing. Wouldn't that be better like
CaretBrush="{TemplateBinding Foreground}"
Along this analogy, for the DataGrid version MaterialDesignDataGridComboBoxEditableTextBox instead of asking the style to do an obscure crawl up into the visual tree for a property (as was in the original PR):
<Setter Property="CaretBrush" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
we could just add MaterialDesignDataGridComboBoxEditableTemplate ControlTemplate's TextBox x:Name="PART_EditableTextBox" the same:
CaretBrush="{TemplateBinding Foreground}"
The latter seems more neat to me.
Version
Latest master