WPF Orientation

前端 未结 4 2069
抹茶落季
抹茶落季 2020-12-01 22:21

I\'m developing an application on a tablet with portrait orientation.

However, when the tablet is turned to landscape mode, the application also turns, and all the a

4条回答
  •  我在风中等你
    2020-12-01 23:09

    I'm not aware of any public API to lock the screen orientation. Mostly because typically, Tablet PC manufacturers provided their own preinstalled utilities or drivers that used accelerometer data to change orientation. It was not a built in OS function. This may be changing in Windows 8.

    While it's not the same as locking orientation, you can try reacting to orientation changes by adding a rotate transform to your root container's LayoutTransform. This would change the layout space so that your application thought it was still rotated 90 degrees but the rest of the OS would not agree. Therefore it's really only practical for full screen applications.

提交回复
热议问题