【问题标题】:Gridsplitter and TouchGridsplitter 和 Touch
【发布时间】:2011-07-05 09:45:56
【问题描述】:

我正在使用 GridSplitter 来调整列的大小(还有什么 :))。工作正常。 但是,我正在 Surface V2 环境中进化,如果我使用触摸模拟,触摸事件不会传输到我亲爱的 GridSplitter。

关于如何使它工作的任何提示?

【问题讨论】:

    标签: wpf xaml touch gridsplitter


    【解决方案1】:

    只需像这样注册事件:

    YourGridSplitter.PreviewDragEnter += new DragEventHandler(YourGridSplitter_PreviewDragEnter);
    
    void YourGridSplitter_PreviewDragEnter(object sender, DragEventArgs e)
    {
       // nothing here
    }
    

    【讨论】:

      【解决方案2】:

      您需要捕获触摸设备。

      gs.PreviewTouchDown += (s, e) => { e.TouchDevice.Capture((s as UIElement)); };
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-11-18
        • 1970-01-01
        • 1970-01-01
        • 2012-04-18
        • 2010-10-17
        • 2011-01-20
        相关资源
        最近更新 更多