加入支持触摸的辅助方法和测试代码
This commit is contained in:
1 parent
b502b8626a
commit
f9ac5d146c
11 files changed
+618
-1
No files matched your search
@@ -0,0 +1,11 @@
|
||||
<Window x:Class="HandyControlDemo.Window.TouchDragMoveWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
|
||||
Title="{ex:Lang Key={x:Static langs:LangKeys.Title}}"
|
||||
Height="450"
|
||||
Width="800"
|
||||
Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
|
||||
</Window>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using HandyControl.Tools.Helper;
|
||||
|
||||
namespace HandyControlDemo.Window
|
||||
{
|
||||
public partial class TouchDragMoveWindow
|
||||
{
|
||||
public TouchDragMoveWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
TouchDown += MainWindow_TouchDown;
|
||||
TouchUp += MainWindow_TouchUp;
|
||||
}
|
||||
|
||||
private void MainWindow_TouchUp(object sender, TouchEventArgs e)
|
||||
{
|
||||
_currentTouchCount--;
|
||||
}
|
||||
|
||||
private void MainWindow_TouchDown(object sender, TouchEventArgs e)
|
||||
{
|
||||
CaptureTouch(e.TouchDevice);
|
||||
|
||||
if (_currentTouchCount == 0)
|
||||
{
|
||||
TouchDragMoveWindowHelper.DragMove(this);
|
||||
}
|
||||
|
||||
_currentTouchCount++;
|
||||
}
|
||||
|
||||
private uint _currentTouchCount;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user