Handling the split screen layout on store apps

MS have told us that an app will get rejected if it does not either re-adapt or have a pause screen when the app is dragged into a “split view”.
Is there some kind of event handler for this?

Hook to WSA.Application.windowSizeChanged event.

Hi, thanks for the reply.
The class WSA does not seem to exist, and Application has no windowSizeChanged event to intercept.
Is there some special namespace needed?

I think this is only supported in 4.3 version. Namespace is UnityEngine.WSA.

Any idea when that is to be released as when i try and update i just get 4.2.2

We’re currently at Beta 6, it should be in a few weeks, unfortunately I don’t know exactly when.

use the VisualStateManagement system in XAML to handle the changes visually, then in code-behind handle changes programmatically by hooking in MainPage.xaml.cs to the “SizeChanged” event.

so, in MainPage constructor add something like:

this.SizeChanged += OnSizeChanged;

add a method like:

void OnSizeChanged(object sender, SizeChangedEventArgs e)
        {
            //view state change detected
            _appViewState = ApplicationView.Value;

            if (_appViewState == ApplicationViewState.Snapped)
            {
               //do stuff here..
            }

Thanks everyone, we eventually solved it by detecting when width was smaller than height from the Screen class, (crude but worked).
Will take a look at this now it is out of beta.

Thanks

Using WSA.Application.windowSizeChanged from within your Unity code your delegate gets passed the resized screen width and height.
You can just compare it to the Screen.Width Unity helpers to determine if your app is in a resized state or not.