我正在使用拇指控件作为尺寸控件。当我移动拇指时,我将光标设置为 SizeWE。但是,当我按下鼠标启动拖动操作时。光标回到指针。
我尝试在拖动过程中明确设置光标,但这不起作用。想法?
<Style x:Key="HorizontalSizeThumbStyle" TargetType="{x:Type Thumb}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Rectangle Name="thumb" Width="1" Stroke="{StaticResource AppBackgroundBrush}" StrokeThickness="0.5" Cursor="SizeWE">
<Rectangle.Fill>
<SolidColorBrush Color="{StaticResource AppBackgroundColor}" />
</Rectangle.Fill>
</Rectangle>
<ControlTemplate.Triggers>
<Trigger Property="IsDragging" Value="True">
<Setter TargetName="thumb" Property="Stroke" Value="{StaticResource PressedBrush}" />
<Setter TargetName="thumb" Property="Cursor" Value="SizeWE" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>