1

WPFのスキャッタービュー内にデータグリッドを配置しています。データグリッドから行をタッチして選択できません。タッチダウンイベントでは、選択したセルの値を返します。ただし、行全体を選択したり、強調表示したりすることはありません。

<Grid Background="{StaticResource WindowBackground}" >
    <s:ScatterView>
        <s:ScatterViewItem Width="500" Height="300"  CanRotate="False" Orientation="0" >
            <DataGrid  AutoGenerateColumns="True" TouchDown="DgTest_TouchDown" Name="DgTest" />
        </s:ScatterViewItem>
    </s:ScatterView>

4

1 に答える 1

1

次のことを試してください。

  // Declare event handlers for the Grid
    DgTest.PreviewTouchDown += new EventHandler<TouchEventArgs>(On_DgTest_PreviewTouchDown);
    DgTest.PreviewTouchUp += new EventHandler<TouchEventArgs>(On_DgTest_PreviewTouchUp );

    void On_DgTest_PreviewTouchDown(object sender, System.Windows.Input.TouchEventArgs e)
    {

    //You need to capture the touch before the ScatterViewItem handles its own touch which will    
    //block you from receiving the touch up event 

    DgTest.CaptureTouch(e.TouchDevice);
    e.Handled = true;

    }

    void On_DgTest_PreviewTouchUp (object sender, System.Windows.Input.TouchEventArgs e)
    {
    DgTest.ReleaseAllTouches();
    }
于 2011-12-14T16:53:28.173 に答える