具有复选框的WPF ComboBox和具有搜索字段的文本框在滚动条上显示文本框

时间:2018-08-17 13:10:25

标签: c# wpf

如何在组合框内的弹出窗口滚动条上显示文本框控件,这是WPF ComboBox with checkboxes and textbox with search field的延续

我也想在文本框和绑定的组合框项目之间显示行距

<Popup 
Name="Popup"
Placement="Bottom"                        
AllowsTransparency="True" 
Focusable="False"  IsOpen="{TemplateBinding IsDropDownOpen}"
PopupAnimation="Slide">
<Grid 
    Name="DropDown"
    SnapsToDevicePixels="True"  
    MinWidth="{TemplateBinding ActualWidth}"
    MaxHeight="{TemplateBinding MaxDropDownHeight}">
    <Border 
        x:Name="DropDownBorder"
        BorderThickness="1" Background="White"
        BorderBrush="Black"/>
    <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True" DataContext="{Binding}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TextBox />
            <StackPanel Grid.Row="1" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
        </Grid>
    </ScrollViewer>
</Grid>

1 个答案:

答案 0 :(得分:1)

尝试将{ "session": "projects\/verifier-26084\/agent\/sessions\/1gg5b76c37f7111b", "queryParams": { "contexts": [ { "name": "projects\/verifier-26084\/agent\/sessions\/1gg5b76c37f7111b\/contexts\/ask-children", "lifespanCount": 1 }] }, "queryInput": { "text": { "text": "\u0442\u0440\u0438", "languageCode": "ru-RU" } } } ScrollViewer放在同一Grid中,但放在另一行中,例如:

TextBox