简体   繁体   中英

How to open keyboard if the device is in 'Tablet Mode'

When clicking on a text field, automatically open up the Windows 10 touch keyboard if the device is in 'Tablet Mode'. How to Know device is in 'Tablet Mode'? How to open keyboard in WPF?

I think this is a misunderstanding. WPF doesn't run in tablet mode at all and doesn't have an on-screen keyboard. It's strictly a desktop-oriented technology. I'm assuming that you are building an applicant in XAML and that you want the same application to run in both places without having to create to separate projects.

WPF is a technology to run XAML in desktop mode whereas a different technology, called WinRT, is required to run applications created in XAML in tablet mode on Windows 10.

If you want to build a single application that is capable of running in both modes, you need to consider adopting an MVVM "framework" to help you out with this task.

The purpose of using MVVM in this context is that it enables you to separate your cross-platform "business logic code" inside classes called "ViewModels" while putting your UI specific code inside a XAML file with a different XAML file being created for each platform you are supporting (for example WPF, Silverlight, Windows Phone, WinRT).

Here are some MVVM frameworks that can help you with this:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM