2

I have a grid with some controls and Background. Inside the grid is also a canvas over the complete grid. On pointer_pressed I paint on the canvas. Works very well in simulator with mouse and finger. If I add a scrollviewer everything looks like expected and the painting works very well with mouse and the moving with the scrollbars works also very well, but on finger it moves the content of the scrollviewer and does not paint. So the behavior is different. For my needs it would be great If I can change the behavior only for these scrollviewer that the finger works like the mouse. Is that in winrt possible?

4

2 回答 2

0

我以前尝试过类似的东西,但做不到。我建议实现您自己的自定义滚动查看器。

于 2012-10-21T21:06:47.070 回答
0

我知道这是几年前的事,但我今天遇到了这个问题并想插话。我在滚动查看器中有一个触摸绘图画布。我决定在墨水画布上有焦点时禁用滚动查看器。

XAML

< Canvas x:Name="InkCanvas" Background="White" Height="100" Width="500" HorizontalAlignment="Left" PointerEntered="CanvasGotFocus" PointerExited="CanvasLostFocus" />

C#

private void CanvasGotFocus(object sender, PointerRoutedEventArgs e)
    {
        scroller.VerticalScrollMode = ScrollMode.Disabled;
    }

    private void CanvasLostFocus(object sender, PointerRoutedEventArgs e)
    {
        scroller.VerticalScrollMode = ScrollMode.Enabled;
    }
于 2014-10-27T23:40:58.363 回答