SilentCoder
SilentCoder

Reputation: 2000

Disable resizing snap view in Windows 8.1

I'm working with a Windows 8 app using Java Script.

In windows 8 there is only one snap view and that is fixed one. But when we come to the windows 8.1 we can resize the snap view. I want to do is keep that fixed size snap view in windows 8.1 also. That means, I want to stop resizing snap view when my windows 8 app running on windows 8.1..

Is there any way for it...?

Looking for example or any guide... Thank you

Upvotes: 0

Views: 2672

Answers (2)

dougajmcdonald
dougajmcdonald

Reputation: 20047

I don't believe you can stop it, as it's a part of the OS and apps are supposed to adhere to it.

You can control your app via media queries in the CSS to fix size to particular values when the app width is at certain values.

Or you can detect the application state and look for 'snapped' and set sizes in the JS code perhaps.

EDIT:

In order to use CSS which applies to the application in snapped mode you can find good examples in the MS Template applications, taken from their CSS you can use:

@media screen and (-ms-view-state: snapped) { // my styles }

Which will allow you to apply specific styles in the snapped state.

Upvotes: 0

Jeremy Foster
Jeremy Foster

Reputation: 4763

@dougajmcdonald is correct. The user is in control and will be able to resize any app to most any size, so your app will need to account for it. You can change the minimum size of your app which gives Windows a hint about where to give the user a snap point. For instance, if you say your app's minimum size is 500px then when the user is dragging the separator, it will snap to 500 pixels, but it will still allow them to resize to say 587 pixels.

Upvotes: 1

Related Questions