Closed bert2 closed 3 years ago
The workaround is the set the Background
to MaterialDesignPaper
:
<matex:Autocomplete
Margin="0,16,0,0"
AutocompleteSource="{Binding}"
Background="{DynamicResource MaterialDesignPaper}"
Hint="commit"
SearchOnInitialFocus="True"
SelectedItem="{Binding SelectedCommit, Mode=TwoWay}"
Style="{StaticResource MaterialDesignAutocompleteDense}">
<matex:Autocomplete.ItemTemplate>
<DataTemplate DataType="{x:Type local:Commit_}">
<TextBlock VerticalAlignment="Center">
<Run FontFamily="Consolas" Text="{Binding ShortSha, Mode=OneWay}" />
<Run Text="{Binding ShortMessage, Mode=OneWay}" />
</TextBlock>
</DataTemplate>
</matex:Autocomplete.ItemTemplate>
</matex:Autocomplete>
@bert2 I use MaterialDesignBackground
as background throughout the templates. It looks like that MaterialDesignInXAML tends to use MaterialDesignPaper
.
Setting the color via the control's color properties might be a solution, because the templates rely on them with bindings and dynamic resources. Another way is to override MaterialDesignBackground
in your App.xaml with the desired color like this:
<SolidColorBrush x:Key="MaterialDesignBackground" Color="{Binding Color, Source={StaticResource MaterialDesignPaper}}" />
@spiegelp, that works too, thanks!
By the way, thank you for making it so super easy to replace those ugly default window borders š
I'm using the
Autocomplete
from MaterialDesignExtensions in an app using MaterialDesignInXAML. Unfortunately the colors of both dark themes do not match:Is there a quick way to make MaterialDesignExtensions use the dark theme colors from MaterialDesignInXAML?
I could probably set the
Background
andForeground
on theAutocomplete
explicitly, but that feels like working around the theming.This is how I'm loading the styles in my
App.xaml
: