question

njsokalski avatar image
0 Votes"
njsokalski asked FayWang-MSFT edited

ApplicationView.GetForCurrentView().ViewMode Returns 2 When Switching From Dual to Single Screen

In my dual screen app, one of the events I attempt to use to detect when my app switches between single & dual screen is SizeChanged. In this event, I look at the following property:

ApplicationView.GetForCurrentView().ViewMode

However, when the user switches from dual screen to single screen, this still returns 2. I would have expected it to return to ApplicationViewMode.Default, since 2 (which is soon to be added as ApplicationViewMode.Spanning) is for dual screen. If I then click the Rotate button on the Emulator, it does return to ApplicationViewMode.Default. It seems like the value is only updated by the hardware (well, the Emulator, but what would be hardware for a real test), but not by the software (unspanning the app). Is this a bug? Is there a workaround? Am I doing something wrong? Thanks.

not-supported
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

May I know how did you switch between dual screen and single screen? Clicking the 'Choose Orientation' button on the Emulator or using code? Can you show more details about it?

0 Votes 0 ·

I switched between dual & single screen by dragging the title bar of the app in the emulator (exactly as a user would on a physical device), my code and the emulator buttons were not used in the dual/single screen switching process. The rotation was done using the emulator buttons.

0 Votes 0 ·

1 Answer

FayWang-MSFT avatar image
0 Votes"
FayWang-MSFT answered

Hello,

Welcome to Microsoft Q&A!

Your issue is about dual screen, it's recommended to ask your question in GitHub-issues of WinUI.

Thanks.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.