Как добавить нижний колонтитул в выпадающий список в выпадающем списке UWP - PullRequest
0 голосов
/ 22 мая 2019

Я занимаюсь разработкой приложения UWP.Я хочу, чтобы нижний колонтитул отображался там, где отображаются элементы списка.Как этого добиться в UWP.Помогите мне реализовать это.

Хотите получить вот такой снимок

Примечание: Здесь используется Microsoft Combobox

1 Ответ

0 голосов
/ 23 мая 2019

Вам просто нужно настроить стиль ComboBox по умолчанию и поместить элемент управления TextBlock в раскрывающемся раскрывающемся списке.

См. Используйте инструменты для удобной работы со стилями , чтобы отредактировать копию стиля ComboBox и найти элемент управления Popup. Поместите TextBlock следующим образом:

<Style x:Key="ComboBoxStyle1" TargetType="ComboBox">
......

<Popup x:Name="Popup">                      
<ScrollViewer>
      <RelativePanel>
            <Border  x:Name="PopupBorder" BackgroundSizing="OuterBorderEdge" Background="{ThemeResource ComboBoxDropDownBackground}" BorderThickness="0 0 0 2" BorderBrush="{ThemeResource ComboBoxDropDownBorderBrush}" HorizontalAlignment="Stretch" Margin="0,-1,0,-1" Padding="{ThemeResource ComboBoxDropdownBorderPadding}">
                   <ScrollViewer x:Name="ScrollViewer" AutomationProperties.AccessibilityView="Raw" BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" Foreground="{ThemeResource ComboBoxDropDownForeground}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" MinWidth="{Binding TemplateSettings.DropDownContentMinWidth, RelativeSource={RelativeSource Mode=TemplatedParent}}" VerticalSnapPointsType="OptionalSingle" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalSnapPointsAlignment="Near" ZoomMode="Disabled">
                        <ItemsPresenter Margin="{ThemeResource ComboBoxDropdownContentMargin}" />
                   </ScrollViewer>
            </Border>
            <TextBlock Text="Manage Styles" RelativePanel.Below="PopupBorder"></TextBlock>
      </RelativePanel>
</ScrollViewer>
</Popup>
...