在WPF自定义扩展元素中扩展内部元素

问题描述 投票:0回答:1
c# wpf user-interface
1个回答
0
投票

您应该能够使用隐式

MaxDropDownHeight
设置
TimePicker
元素的
Style
属性:

<xctk:DateTimePicker x:Name="DTCalendar" Margin="10,10,10,0" VerticalAlignment="Top" ValueChanged="DTCalendar_ValueChanged" 
                     Width="234" Height="34" Format="Custom" FormatString="dd ddd yyyy, HH:mm" FontSize="14" FontWeight="Bold" 
                     HorizontalContentAlignment="Center">
    <xctk:DateTimePicker.Resources>
        <Style TargetType="xctk:TimePicker">
            <Setter Property="MaxDropDownHeight" Value="1000" />
        </Style>
    </xctk:DateTimePicker.Resources>
</xctk:DateTimePicker>
© www.soinside.com 2019 - 2024. All rights reserved.