WPF 有好的时间跨度控件吗?我正在寻找一个看起来像 WPF Toolkit 扩展中的 Timepicker(小而紧凑)的工具。我从 codeproject 看到的示例对于我的 UI 来说太大了。如果没有,我愿意自己创建一个并寻求建议。谢谢
我正在使用这个我定制的:
<Slider Name="sldrTime" Width="500" Height="30" Minimum="0" Maximum="480" TickPlacement="Both" HorizontalAlignment="Right"
Value="{Binding REPAIR_TIME,Mode=TwoWay}" IsSnapToTickEnabled="True" TickFrequency="15" Margin="0,20,0,0"
Foreground="Blue" Background="Orange" LargeChange="15" SmallChange="15" >
<Slider.Template>
<ControlTemplate TargetType="Slider">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TickBar x:Name="TopTick" Grid.Row="0" Visibility="Collapsed" Fill="Yellow" Placement="Top" Height="20"/>
<Border x:Name="PART_SelectionRange" Grid.Row="1" CornerRadius="15" Background="Red" BorderThickness="2" Height="20"/>
<Track x:Name="PART_Track" Grid.Row="1">
<Track.DecreaseRepeatButton>
<RepeatButton Command="Slider.DecreaseLarge" Background="Green" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Command="Slider.IncreaseLarge" Background="Red"/>
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb x:Name="Thumb" Background="LightYellow" Width="20" BorderBrush="PaleVioletRed" BorderThickness="1"/>
</Track.Thumb>
</Track>
<TickBar x:Name="BottomTick" Grid.Row="2" Visibility="Visible" Fill="{TemplateBinding Foreground}" Placement="Bottom" Height="20"/>
</Grid>
</ControlTemplate>
</Slider.Template>
</Slider>
希望这有帮助!