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

Nathan Sokalski 4,126 Reputation points

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

    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
        case 1: // CompactOverlay
        case 2: // Spanning
            throw new ArgumentOutOfRangeException();
    0 comments No comments

0 additional answers

Sort by: Most helpful