public class SfChartExt : SfChart
{
protected override void OnMouseDown(MouseButtonEventArgs e)
{
base.OnMouseDown(e);
if (e.ChangedButton == MouseButton.Middle && e.ButtonState == MouseButtonState.Pressed)
foreach (var behavior in Behaviors)
{
if (behavior is ChartZoomPanBehaviorExt)
(behavior as ChartZoomPanBehaviorExt).MouseLeftButtonDown(e);
}
}
protected override void OnMouseUp(MouseButtonEventArgs e)
{
base.OnMouseUp(e);
if (e.ChangedButton == MouseButton.Middle && e.ButtonState == MouseButtonState.Released)
foreach (var behavior in Behaviors)
{
if (behavior is ChartZoomPanBehaviorExt)
(behavior as ChartZoomPanBehaviorExt).MouseLeftButtonUp(e);
}
}
}
public class ChartZoomPanBehaviorExt : ChartZoomPanBehavior
{
public void MouseLeftButtonUp(MouseButtonEventArgs e)
{
OnMouseLeftButtonUp(e);
}
public void MouseLeftButtonDown(MouseButtonEventArgs e)
{
OnMouseLeftButtonDown(e);
}
}
|