locked
[UWP]Changing resolutions and pivot control. What is the easiest implementation? RRS feed

  • Question

  • I have the old WP8 app that uses pivots to display information. Porting this app to Windows 10 phones is quite easy as I can reuse the same pivot design. With desktop and tablet versions I am stuck. Displaying just one pivot item at a time would make no sense as it would take only a fraction of the screen leaving remainder empty. "Flattening" entire pivot would work if all information fits on the screen but if only some information fits then horizontal scrolling would be awkward.

    So here are two things that I am looking for:

    1. Some kind of a pivot-like control that would work as a regular pivot on a narrow screen, "flat" grid on a wide screen and a "few items at a time" pivot in between. I have not seen any controls like this yet. Did I miss something?

    2. If there is no easy solution for #1 then what would be the easiest way to reuse XAML code of pivot items? In my case each XAML item is a pretty complex group of controls that would be too expensive to duplicate for each resolution or device type. Solution like android's include directives would be great way to do it but I have not seen equivalent in XAML.


    Sunday, April 24, 2016 5:18 PM

Answers

  • Hi PaulDotNet,

    Have you looked at other navigation strategies like for example Hub Control? 

    Please see: Hub control/pattern

    A hub control lets you organize app content into distinct, yet related, sections or categories. Sections in a hub are meant to be traversed in a preferred order, and can serve as the starting point for more detailed experiences.

    Also Please see: Navigation design basics for Universal Windows Platform (UWP) apps.

    >> In my case each XAML item is a pretty complex group of controls that would be too expensive to duplicate for each resolution or device type. 

    Have you looked into Adaptive Trigger Class

    You can use Visual States to Adjust your layout using adaptive triggers based on screen size. you would not need to duplicate your code. 

    Please see: Responsiveness techniques Sample

    With Regards,

    Krunal Parekh 


    Thanks MSDN Community Support Please remember to Mark as Answer the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Proposed as answer by Krunal Parekh Tuesday, April 26, 2016 5:46 AM
    • Marked as answer by PaulDotNet Wednesday, April 27, 2016 4:54 AM
    Monday, April 25, 2016 2:35 AM

All replies

  • Hi PaulDotNet,

    Have you looked at other navigation strategies like for example Hub Control? 

    Please see: Hub control/pattern

    A hub control lets you organize app content into distinct, yet related, sections or categories. Sections in a hub are meant to be traversed in a preferred order, and can serve as the starting point for more detailed experiences.

    Also Please see: Navigation design basics for Universal Windows Platform (UWP) apps.

    >> In my case each XAML item is a pretty complex group of controls that would be too expensive to duplicate for each resolution or device type. 

    Have you looked into Adaptive Trigger Class

    You can use Visual States to Adjust your layout using adaptive triggers based on screen size. you would not need to duplicate your code. 

    Please see: Responsiveness techniques Sample

    With Regards,

    Krunal Parekh 


    Thanks MSDN Community Support Please remember to Mark as Answer the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Proposed as answer by Krunal Parekh Tuesday, April 26, 2016 5:46 AM
    • Marked as answer by PaulDotNet Wednesday, April 27, 2016 4:54 AM
    Monday, April 25, 2016 2:35 AM
  • Hub seems the closest solution to my needs but on the phone it is not as convenient as pivot. On a screen like a small tablet it may still require some tweaking.

    The best solution for control reuse that I see is to create user controls from each pivot item and then based on platform or using adaptive triggers place controls into pivot or hub or just plain scroll old view.

    Wednesday, April 27, 2016 4:54 AM