2

I have an application that really makes no sense for snapped view, as the content generally represents A4 pages of information and data collection.

Is there a way to disable snapped view for the application, or is the recommended approach to just show the application icon, while in snapped mode?

Predominant
  • 1,460
  • 12
  • 24
  • you could show resized pages thumbnail style, top to bottom. while it might not be the most useful thing ever, it's better than doing nothing. – John Gardner Oct 11 '12 at 16:43

2 Answers2

10

You cannot disable snapped view.

Simply just create a new page and navigate to that page if a snap event occurred. You can simply display an image.

Window.Current.SizeChanged += (object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) =>
                {
                    ApplicationViewState myViewState = ApplicationView.Value;

                    if (myViewState == ApplicationViewState.Snapped)
                    {
                        //await SaveAssets();
                        this.Frame.Navigate(typeof(Snapped));
                        Snapped = true;
                    }
                    else if (myViewState != ApplicationViewState.Snapped)
                    {
                        if (Snapped)
                        {
                            this.Frame.Navigate(typeof(MainPage));
                            Snapped = false;
                        }
                    }
                };
  • The above answer while correct in spirit is for XAML, not HTML – Dominic Hopton Sep 03 '12 at 00:22
  • Ah I didn't notice the winjs tag, I guess there is something similar for js. –  Sep 03 '12 at 00:27
  • http://blogs.msdn.com/b/windowsappdev/archive/2012/04/19/getting-the-most-out-of-your-pixels-adapting-to-view-state-changes.aspx This is what I used to achieve a result with WinJS. Rob's answer regarding the capabilities is what I was after, the specific tech was secondary to the question. Thanks again. – Predominant Sep 03 '12 at 01:27
0

I really like Robert's solution. Based upon that, you can simulate disabling snapped view:

Window.Current.SizeChanged += async (object sender, WindowSizeChangedEventArgs e) =>
        {
            ApplicationViewState myViewState = ApplicationView.Value;
            if (myViewState == ApplicationViewState.Snapped)
            {
                if (!ApplicationView.TryUnsnap())
                {
                    MessageDialog dialog = new MessageDialog("Sorry, this App is unusable in snapped mode.");
                    await dialog.ShowAsync();
                }
            }
        };  
Gergely Máté
  • 107
  • 2
  • 11