Windows App SDK 1.0 中的中断性变更
如果要将应用从 0.8 稳定版迁移到 Windows App SDK 1.0,此处列出的中断性变更可能会影响你。 变更按技术领域(如输入和 MRT Core)分组。
输入
从 0.8 到 1.0 的 API 变更
- 无法访问实验类型 | API 变更 |
- 添加了稳定版 Microsoft.UI.Input.PointerPoint。 它取代了 Microsoft.UI.Input.Experimental.ExpPointerPoint。
- PointerPoint 现在引用 Microsoft.UI.Input 枚举和结构,而不是 Windows.UI.* 枚举和结构(例如,IPointerPointTransform、PointerUpdateKind、PointerDeviceType)。
- PointerPoint 现在具有完全敏捷性。
- 删除了 PointerPoint 静态函数 GetCurrentPoint、GetCurrentPointTransformed、GetIntermediatePoints 和 GetIntermediatePointsTransformed。 它们被 PointerPoint 和 PointerEventArgs 上的成员函数取代。
- 新的 GetTransformedPoint 方法。
- 从 PointerPointProperties 中删除了 ContactRectRaw。
- 删除了 RawPosition 属性。
- 添加了稳定版 Microsoft.UI.Input.PointerEventArgs。 它取代了 Microsoft.UI.Input.Internal.ExpPointerEventArgs。
- 添加了稳定版 Microsoft.UI.Input.GestureRecognizer。 它取代了 Microsoft.UI.Input.Experimental.ExpGestureRecognizer。 引用 Microsoft.UI.Input 枚举、结构和类,而不是 Windows.UI.Input.* 和 Windows.UI.Core.* 类型(例如,GestureSettings、ManipulationDelta、TappedEventArgs)。
- 添加了公共稳定版 InputCursor、InputSystemCursor 和 InputDesktopResourceCursor。 它们取代了以前对 0.8 API 图面中 Windows.UI.Core.CoreCursor 的引用。
- 添加了公共稳定版 InputPointerSource。它从 XAML SwapChainPanel 类返回,而不是从以前的实验版 Microsoft.UI.Input .Experimental.ExpIndependentPointerInputObserver 类返回。
- 引用 Microsoft.UI.Input.InputCursor 而不是 Windows.UI.Core.CoreCursor。
- 引用 Microsoft.UI.Input 结构、枚举和类型,而不是 Windows.UI.* 类型,例如 PointerEventArgs 和 InputPointerSourceDeviceKinds。
- Type 不再显式可关闭。
- Microsoft.UI.Input.KeyboardInput 重命名为 Microsoft.UI.Input.InputKeyboardSource。
从 0.8 到 1.0 的行为变更
- 底层输入系统基础结构升级为使用独立的消息队列进行处理。
- 支持低延迟的 UI 线程外输入,例如墨迹书写。
- 完全支持提升的交互跟踪器 API,例如 Microsoft.UI.Composition.VisualInteractionSource(及其他)。
- 完全支持对线程外输入传递使用悬停输入(这是 0.8 中的限制)。
- 系统输入消息(如 WM_POINTERDOWN)不再通过 Win32 API 在 UI 线程上可见,因为它们被路由到基础结构中的独立消息队列。
- PointerPoint 现在很敏捷,可在任何线程上访问。
- 无法再从指针 ID 静态构造 PointerPoint 对象。
- 基于 XAML 的拖放操作完全支持鼠标、触摸和笔输入(0.8 使用下层的笔到鼠标)。
- 在 UI 线程上,不能再直接使用 Windows.ApplicationModel.DataTransfer.DragDrop.Core.CoreDragOperation。 必须改用 XAML 拖放。
MRT 核心
MRT Core API 已从 Microsoft.ApplicationModel.Resources 命名空间移动到 Microsoft.Windows.ApplicationModel.Resources 命名空间。