【发布时间】:2021-09-06 20:22:51
【问题描述】:
我的语言ComboBox 可以完美运行,但是在单击更改语言后,会出现这个奇怪的蓝色下划线。我不太确定这是从哪里来的
<ComboBox ItemsSource="{Binding SupportedLanguages, Mode=OneTime}"
Name="LanguageComboBox"
Padding="2"
BorderThickness="0"
BorderBrush="Transparent"
HorizontalAlignment="Right"
SelectedItem="{Binding SelectedLanguageName}"
Background="Transparent"
UseLayoutRounding="True">
<ComboBox.ItemTemplate>
<DataTemplate DataType="model:CountryFlagDto">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Path=LangKey, Converter={StaticResource CountryIdToFlagImageSourceConverter}}"
Width="23" Height="34" RenderOptions.BitmapScalingMode="HighQuality" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
【问题讨论】:
-
图像尺寸也与 Width="23" Height="34" 匹配?它看起来像一个焦点颜色。
-
@Expressingx 您在使用 MahApps.Metro 或 MaterialDesign 等第三方库吗?
-
我无法重现该问题。是不是,在某个地方你对
ComboBox有一种隐含的风格?也尝试明确设置ComboBox.IsEditable = "False"
标签: wpf xaml material-design-in-xaml