question

njsokalski avatar image
0 Votes"
njsokalski asked ·

When to Modify the TwoPaneView Layout

I am working on learning how to use the TwoPaneView with Dual Screen devices. Using the following page:

https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/two-pane-view

I have determined that this would be done using the ModeChanged event. However, the 2 things I need to know are:

Orientation: I believe I can get this from the Mode property during the ModeChanged event (Tall or Wide)
Single or Double Pane: I would have thought I could get this from the Mode property as well, but TwoPaneViewMode only contains a SinglePane value, which does not tell me the orientation

I have also noticed (and maybe this is just me) that ModeChanged does not seem to always get triggered, especially for SinglePane (or maybe this is just the Microsoft Emulator). But either way, I'm not sure how to get the info I need to determine how to determine the appropriate layout adjustments. Can somebody help me? Thanks.

not-supported
· 1
10 |1000 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.

Hello, according to the test, TwoPaneView can return the mode information of the current control (such as Wide or Tall) when ModeChanged. If you always return SinglePane, you can provide the xaml code for us to analyze, it will be helpful. In addition, this event will be triggered only when TwoPaneView.Mode changes. If it is in the same state, for example, the application moves from the left to the right, because the Mode has not changed, the event will not be triggered.

0 Votes 0 ·
njsokalski avatar image
0 Votes"
njsokalski answered ·

I think I may be better off using the SizeChanged event of the Page, since it seems like ModeChanged is not triggered when using only 1 screen. I'm not sure how else to be always notified for the layout changes I need to make. I may end up making use of ModeChanged once I am more familiar with the Mode property and TwoPaneView, but for now, I might need to save that for the future.

·
10 |1000 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.

RoyLi-MSFT avatar image
0 Votes"
RoyLi-MSFT answered ·

Hello,

Welcome to Microsoft Q&A!

Your issue about TwoPaneView is more related to WinUI. It's an open-source in Github, you could ask your question in GitHub-issues.

Thank you.


·
10 |1000 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.