我需要在 Combobox 中每个弹出的行下方添加一行。所以现在我的 Combobox 看起来像这样:
并弹出使用此 XAML 代码实现的行:
<Popup Name="PART_Popup"
WindowManagerAddShadowHint="False"
IsOpen="{TemplateBinding IsDropDownOpen, Mode=TwoWay}"
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
PlacementTarget="{TemplateBinding}"
IsLightDismissEnabled="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Border x:Name="PopupBorder"
Grid.Row="1"
Background="#00A9FF"
BorderBrush="Black"
BorderThickness="{DynamicResource ComboBoxDropdownBorderThickness}"
Margin="0,-1,0,-1"
Padding="0"
HorizontalAlignment="Stretch"
CornerRadius="0"
Grid.Column="2"
>
<ScrollViewer>
<ItemsPresenter Name="PART_ItemsPresenter"
Items="{TemplateBinding Items}"
Margin="{DynamicResource ComboBoxDropdownContentMargin}"
ItemsPanel="{TemplateBinding ItemsPanel}"
ItemTemplate="{TemplateBinding ItemTemplate}"
VirtualizationMode="{TemplateBinding VirtualizationMode}"
/>
</ScrollViewer>
</Border>
</Grid>
</Popup>
我无法插入一些额外的边框来使线条出现,所以我不知道该怎么做。