Welcome to MSDN Blogs Sign in | Join | Help
WPF4 ベータ2でのタッチアプリケーションについて

Visual Studio 2010 ベータ2に含まれているWPF 4でマルチタッチのアプリを作ろうとして、ベータ1との違いを調べていました。ローカルドキュメントには含まれていませんが、MSDNライブラリにウォークスルーが公開されています。
一番大きく変わったのが、FrameworkElementに記述していた「ManipulationMode="All"」が無くなって、「IsManipulationEnabled="True"」に変更になったことです。この変更に伴って、「ManipulationStartingイベント」でManipulationContainerを設定する必要があります。ManipulationModeは、ManipulationStartingEventArgs.Modeプロパティで設定するようになっています。この値のデフォルトが「All」になっています。

そしてウォークスルーでは、InertiaStartingのイベントハンドラでTranslationBehavior、ExpansionBehavior、RotationBehaiviorを設定しています。このBehaiviorに、移動量を設定しています。また、ManipulationDeltaイベントハンドラの最後にあるif文である「if (e.IsInertial && !containingRect.Contains(shapeBounds))」で境界を越えた時点で動作を終了するようになっています。この境界における制御なのですが、InertiaProcessorの場合はボーダーとエラスティック・マージンという考え方があるのですが、この考え方の適用方法はまだ調べきれていません。

これ以外には、WM_Touchイベントも処理できるようになっています。

Posted: Friday, November 06, 2009 4:53 PM by shozoa
Filed under:

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker