ApplicationViewMode: What to do when a 2 is returned but ApplicationViewMode.Spanning is not included?

Nathan Sokalski 4,121 Reputation points
2020-06-18T03:17:20.807+00:00

I am working on a dual screen app, and I am looking at the value returned by ApplicationView.GetForCurrentView().ViewMode. My app is returning a value of 2, which is kind of what I expect, except that the ApplicationViewMode enumeration (at least according to Intellisense) only includes Default & CompactOverlay. I understand that ApplicationViewMode.Spanning is being added, which will (I'm assuming) have a value of 2. But since Intellisense does not list this, what should I do when checking the value returned by ApplicationView.GetForCurrentView().ViewMode? Thanks.

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Daniele 1,996 Reputation points
    2020-06-18T06:35:06.513+00:00

    While waiting that the SDK includes ApplicationViewMode.Spanning value you can do something like that:

    ApplicationViewMode applicationViewMode = ApplicationView.GetForCurrentView().ViewMode;
    switch ((int)applicationViewMode)
    {
        case 0: // Default
            break;
        case 1: // CompactOverlay
            break;
        case 2: // Spanning
            break;
        default:
            throw new ArgumentOutOfRangeException();
    }
    
    0 comments No comments

0 additional answers

Sort by: Most helpful