locked
Converting Windows Store app from 8.0 to 8.1 RRS feed

  • Question

  • I have an app I want to update to 8.1. I have done the upgrade in Visual Studio and everything works fine, but the only thing that bothers me is that the layout options has changed.

    Is it possible to keep only the minimum width of 320 pixels and the full view? Now when the user makes the app take 50% of the screen it displays the full screen style. The problem is that my full screen view requires the full screen (and not 50%).

    So I would like something like this

    <Application>
       <VisualElements>
          <ApplicationView MinWidth=”width320” />
          <ApplicationView MinWidth=”above320” />
       </VisualElements>
    </Application>

    So I have my snapped view at 320 (same as 8.1). If the user increase the app's width above 320 px it takes the whole width.

    Is this possible?

    Monday, December 23, 2013 10:23 PM

Answers

All replies

  • No, the user can choose any size between 500 and the screen size. The app needs to be able to handle the intermediate sizes well. How best to do this depends on the app: a typical solution will have layouts designed for portrait and landscape modes based on if the width or the height of the window is larger.

    --Rob

    Tuesday, December 24, 2013 12:33 AM
    Moderator
  • Ok so how do I define a style for width =320-450, one for 450-screensize, and one for the whole screen?
    Tuesday, December 24, 2013 12:35 PM
  • See Quickstart: Designing apps for different window sizes for an overview. You can define different Visual States in Xaml for the different sizes and then call VisualStateManager.GoToState to switch to the appropriate state in the window's SizeChanged event handler.

    --Rob

    Friday, December 27, 2013 12:20 AM
    Moderator
  • I made a little tutorial for doing this in code behind. It covers the basics, and you can adapt it for more complex layout changes.

    Change Screen Layout When Screen Size Changes in Windows 8.1


    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.

    Sunday, December 29, 2013 4:54 AM
  • Pumpkinszwan, you might want to read the Quickstart I linked. Using Visual States rather than hardcoding changes in code-behind is very powerful and will make anything beyond trivial changes much simpler.

    --Rob

    Sunday, December 29, 2013 5:15 AM
    Moderator