开发者

Disabling touch sliding on listboxes Windows 7

Touch sliding support on ScrollViewer is working natively in windows7 (maybe vista). But not in XP.

I want to implement touch sliding in windows XP. To do that, I want to implement a custom sliding that will be working on XP and vista.

How I can disable native开发者_StackOverflow中文版 sliding support on the the ScrollViewer that I will want to replace to custom sliding?


The PanningMode property of the ScrollViewer will act on native handling of touch events for that control.

In that particular case, to disable listbox panning.

You will have to create a ListBox style and override the ControlTemplate of the listbox to add to the nested ScrollViewer the PanningMode="PanningMode.None" property.

<Style TargetType="{x:Type ListBox}">
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type ListBox}">
...
        <ScrollViewer PanningMode="PanningMode.None"/>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜