Hello.
I am using RadImageEditor.
I'm done with the setup. It actually works too.
But when I shift + wheel, not only horizontal movement but also vertical scrolling.
I want to move only horizontal scrolling when shift is pressed.
Which part should I control?
<telerik:RadImageEditor x:Name="xImageEditor" Image="{Binding RadImage}" behaviour:HorizontalScrollViewerHelper.IsShiftWheelProperty="True" IsPanningEnabled="True"/>
<imageEditor:ZoomController ImageEditor="{Binding ElementName=xImageEditor}" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
public static class HorizontalScrollViewerHelper
{
public static bool GetIsShiftWheelProperty(DependencyObject obj) => (bool)obj.GetValue(IsShiftWheelProperty);
public static void SetIsShiftWheelProperty(DependencyObject obj, bool value) => obj.SetValue(IsShiftWheelProperty, value);
public static readonly DependencyProperty IsShiftWheelProperty
= DependencyProperty.RegisterAttached("IsShiftWheel",
typeof(bool),
typeof(HorizontalScrollViewerHelper),
new PropertyMetadata(false, HorizontalScrollCallback));
private static void HorizontalScrollCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var imageEditor = d as RadImageEditor;
imageEditor.PreviewMouseWheel += ImageEditor_PreviewMouseWheel;
}
private static void ImageEditor_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
if (((RadImageEditor)sender).ChildrenOfType<ScrollViewer>().FirstOrDefault() is ScrollViewer scrollViewer)
{
if(Keyboard.Modifiers.Equals(ModifierKeys.Shift))
{
if (e.Delta < 0)
{
scrollViewer.LineRight();
}
else
{
scrollViewer.LineLeft();
}
//scrollViewer.ScrollToHorizontalOffset(scrollViewer.HorizontalOffset + (-e.Delta / 300));
}
}
}
}
Thanks.
Is there any shift wheel feature provided by Telerik? Visual studio xaml shift wheel function.