将 WPF 应用程序重写到 Surface

发布于 2024-08-21 12:53:09 字数 334 浏览 3 评论 0原文

我正在开发一个 WPF 应用程序,我很好奇如果有一天我们想通过多点触控来控制它,需要什么才能将该应用程序重写为 Surface 应用程序。

我们是否可以重用 WPF 应用程序的大部分内容并将其顺利转移到 Surface,或者 Surface 完全不同,我们可能必须为 Surface 编写一个全新的 GUI?或者我实际上可以在 Surface 上使用 WPF 应用程序吗?正如您可能知道的那样,我对 Surface 一点也不了解 - 所以也请告诉我任何明显的事情!

我们尽我们所能对应用程序进行建模,使视图和业务逻辑之间有良好的分离 - 使用 MVVM 模式等。但是我们是否需要为 Surface 构建一个全新的 GUI?

I'm working on a WPF application, and I'm curious about what it would take to rewrite this application to a Surface application if we want to control it through multitouch some day.

Is it likely that we can reuse big parts of our WPF application and transfer it smoothly to Surface, or is Surface completely different, and we probably have to write a completely new GUI for Surface? Or can I actually use WPF applications on Surface? As you maybe can tell I don't really have a clue at all regarding Surface - so please tell me anything obvious too!

We do what we can to model the application with good separation between the View and the business logic - using the MVVM pattern etc. But do we need to build a completely new GUI for surface?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

匿名的好友 2024-08-28 12:53:09

如果您的目标只是向普通桌面应用程序添加多点触控,那么您确实应该考虑 Windows 7 中的 .NET 4.0。这样做时,您可以从现有应用程序开始,然后添加您认为有用的任何多点触控功能。

如果您确实转到 Surface,那么您在代码中看到的主要更改(如果进行直接移植)会将所有内置输入控件更改为 Surface 版本(即,将 Button 更改为 s:SurfaceButton)。需要这样做是为了支持 Surface 的接触输入,它不会激活像 Button.Click 这样的标准控件。

Surface 应用程序还有一些更重要的问题,仅在桌面上使用模拟器无法真正感受到这些问题。首先是多用户体验,不仅包括其支持的大量同时触摸,还包括 UI 的多方向定位。由于 Surface 是水平屏幕,用户可以从任何一侧访问应用程序,并且应用程序本身也可以垂直翻转,具体取决于用户启动应用程序的方向。这可能需要大量思考如何重新设计桌面应用程序的功能。 Surface 还具有 1024x768 的固定分辨率,这也可能导致从专为大屏幕设计的动态大小的桌面应用程序进行尴尬的过渡。

If your goal is simply to add multi-touch to a normal desktop application you should really be looking at .NET 4.0 in Windows 7. Doing that you can start with your existing application and just add on any multi-touch features you find useful.

If you do go to Surface, the primary changes you'd see in your code if doing a direct port would be changing all of the built-in input controls to the Surface versions (i.e. Button to s:SurfaceButton). This needs to be done to support Surface's Contact inputs, which don't activate things like Button.Click on the standard controls.

There are a few more important concerns with Surface applications that you can't really get a feel for just using the emulator on your desktop. First is the multi-user experience, including not only the huge number of simultaneous touches it supports, but also the multi-directional orientation of the UI. Since the Surface is a horizontal screen users can come at the application from any side and the application itself can also be flipped vertically depending on which direction the user starts the application from. This can require a lot of thought around how the features of a desktop app need to be reworked. Surface also has a fixed resolution of 1024x768 which can also make for awkward transitions from dynamically sized desktop apps made for large screens.

暗恋未遂 2024-08-28 12:53:09

如果应用程序仅使用基本的 WPF 控件,那么理想情况下,您可能需要移植到 Surface 的更改非常小。如果您已经在代码中执行了一些 Mouseevents,只需将所有典型的 WPF 控件替换为相应的 Surface 控件并添加适当的 Contact 事件即可。

当然,基于 Surface 上您可能需要的特殊 MultiTouch 体验,XAML 样式和 LayOut 可能会有很大不同,但是当您遵循正确的 MVVM 时,您不需要更改任何 C# 代码以及项目的整体 UserControl 结构。因此,请确保将项目设置为 ViewViewModel,以便 SurfaceView 和 WPFView 项目引用相同的 MVVM dll。

If the app has used only basic WPF controls then ideally the change you might need to port ot Surface is very minimal. Just need to replace all typical WPF controls to corresponding Surfacecontrols and add appropriate Contact events if you already did some Mousevents in the code.

Ofcourse based on the special MultiTouch experience you may need at Surface the XAML Styles and LayOut can be quite different, But when you follow proper MVVM you dont need to change any C# code as well as the over all UserControl structure of the project. So make sure to make the projects as View and ViewModel so that you can have a SurfaceView and WPFView projects referring the same MVVM dll.

断桥再见 2024-08-28 12:53:09

WPF 目前是 Surface 开发的主要平台。

Microsoft Surface 博客有一篇关于 与 Surface 开发相关的 WPF 资源

WPF is the primary platform for Surface development, right now.

The Microsoft Surface Blog has a great article on WPF resources related to Surface development.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文