我有一個WPF 4應用程序,我已經使用標準DragDrop.DoDragDrop
方法實現了拖放操作,但是我使用觸摸來代替鼠標事件。WPF 4多點觸控拖放
我爲我的網XAML(即林拖動)如下:
<Grid x:Name="LayoutRoot"
ManipulationStarting="ManipulationStarting"
ManipulationDelta="ManipulationDelta"
ManipulationCompleted="ManipulationCompleted"
IsManipulationEnabled="True">
<!-- children in here -->
</Grid>
現在後面的代碼是這樣的:
private void ManipulationStarting(object sender, ManipulationStartingEventArgs e)
{
e.ManipulationContainer = this;
e.Handled = true;
}
private void ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
{
e.Handled = true;
DragDrop.DoDragDrop(this, new DataObject(GetType(), this), DragDropEffects.Move);
}
private void ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
//completed stuff
}
但當我嘗試用一個拖手指在已經用另一個手指拖動的情況下(例如不同的手,例如可以模擬兩個人)第二次觸摸似乎沒有正確註冊,事實上,Windows似乎認爲我的兩個手指正在嘗試縮放(如捏手勢)...
有沒有人知道一種方法來解決這個問題?
非常感謝 馬克
感謝Josh,請看看 – Mark 2010-08-29 23:44:35
截至2013年3月21日,Surface 2.0 SDK和Runtime可供下載,網址爲:http://www.microsoft.com/en-us/download/details。 ASPX?ID = 26716 – 2013-03-21 15:52:42