WPF DevExpress LookUpEdit弹出窗口太高

WPF DevExpress LookUpEdit弹出窗口太高,wpf,devexpress,Wpf,Devexpress,我正在WPF用户控件中使用DevExpress LookUpEdit组件。我的问题是弹出框总是比PopupContentTemplate中项目的内容大得多。我似乎找不到一个属性来管理它,或者我可能正在不正确地使用控件(?) 谢谢 <UserControl xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" x:Class="FTI_Opp_WPF.Views.UserControls.ViewSel

我正在WPF用户控件中使用DevExpress LookUpEdit组件。我的问题是弹出框总是比PopupContentTemplate中项目的内容大得多。我似乎找不到一个属性来管理它,或者我可能正在不正确地使用控件(?)

谢谢

<UserControl xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"  
    x:Class="FTI_Opp_WPF.Views.UserControls.ViewSelector"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    mc:Ignorable="d">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary
                    Source="../../Common/Styles.xaml" />
                <ResourceDictionary
                    Source="../../Common/Strings.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Label Grid.Column="0" FontSize="12" Foreground="gray" Margin="0,-2,1,0">View:</Label>

        <dxg:LookUpEdit
            Grid.Column="1"
            dx:ThemeManager.ThemeName="MetropolisLight"
            Name="viewLookupEdit"
            AutoPopulateColumns="False"
            AutoComplete="True"
            IncrementalFiltering="True"
            ImmediatePopup="True"
            IsReadOnly="True"
            HorizontalAlignment="Right"
            VerticalAlignment="Top"
            Text="{Binding SelectedViewName}"
            ShowSizeGrip="false"
            MinWidth="200">
            <dxg:LookUpEdit.PopupContentTemplate>
                <ControlTemplate>
                    <StackPanel Orientation="Vertical" Height="auto">
                        <ListBox Name="lstMain" 
                                 ItemsSource="{Binding Path=GridViews}" 
                                 HorizontalAlignment="Stretch"
                                 BorderThickness="1"
                                 MouseUp="OnRowMouseUp">
                            <ListBox.ItemContainerStyle>
                                <Style
                                    TargetType="{x:Type ListBoxItem}">
                                    <Setter Property="BorderThickness">
                                        <Setter.Value>1</Setter.Value>
                                    </Setter>
                                    <Setter
                                        Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate
                                                TargetType="{x:Type ListBoxItem}">
                                                <Grid Name="gridView" Height="25">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="14"/>
                                                        <ColumnDefinition Width="*"/>
                                                    </Grid.ColumnDefinitions>

                                                    <Image Grid.Column="0"
                                                        Margin="0,-2,0,0"
                                                        Visibility="Visible"
                                                        Source="..\..\Images\globe.png"
                                                        Height="12"
                                                        Width="12" />

                                                    <TextBlock 
                                                        Margin="2,3,0,0" 
                                                        Grid.Column="1" 
                                                        Name="viewName" 
                                                        VerticalAlignment="Stretch"  
                                                        Text="{Binding Path=Name}"/>
                                                </Grid>
                                                <ControlTemplate.Triggers>
                                                    <Trigger
                                                        Property="IsMouseOver"
                                                        Value="true">
                                                        <Setter
                                                            TargetName="gridView"
                                                            Property="Background" Value="{Binding Converter={StaticResource StyleConverter},ConverterParameter=HOVER_BACKGROUND_COLOR}">
                                                        </Setter>
                                                        <Setter
                                                            TargetName="viewName"
                                                            Property="Foreground" Value="White">
                                                        </Setter>
                                                        <Setter
                                                            TargetName="viewName"
                                                            Property="FontWeight" Value="BOLD">
                                                        </Setter>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>

                                    <Style.Triggers>
                                        <DataTrigger
                                            Binding="{Binding Path=IsEnabled}"
                                            Value="False">
                                            <Setter
                                                Property="IsEnabled"
                                                Value="{Binding Path=IsEnabled}" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </ListBox.ItemContainerStyle>
                        </ListBox>
                        <Button
                            Name="btnAdvanced"
                            Margin="10,0,0,0"
                            Style="{StaticResource Link}"
                            Content="manage views"
                            Click="OnManageViewsClick" />

                    </StackPanel>
                </ControlTemplate>
            </dxg:LookUpEdit.PopupContentTemplate>
        </dxg:LookUpEdit>
    </Grid>
</UserControl>


视图:
1.
DX不提供“自动调整弹出内容大小”功能。您需要使用PopupMinHeight/PopupMaxHeight/PopupLight


请参阅此链接:

Ahh。。。根据用户名判断,您可能就是在DX论坛上发布该信息的人。:)