locked
Snapping by code => Start external app RRS feed

  • Question

  • Hi

    I want to Show a PDF in My app. Anyhow possible to start the Default PDF Viewer and snap My app to the left side at the same time?

    THanks

                 // Set the option to show the picker
                    var options = new Windows.System.LauncherOptions();
                    options.UI.PreferredPlacement = Windows.UI.Popups.Placement.Right;
                    options.DisplayApplicationPicker = false;
    
                    // Launch the retrieved file
                    bool success = await Windows.System.Launcher.LaunchFileAsync(file, options);

    Saturday, August 3, 2013 7:14 PM

Answers

  • This is not possible in Windows 8. Apps cannot explicitely snap themselves. Only the user can. The PreferredPlacement property refers the Open With or Placement dialogs which may be shown when launching an app, not the launched app itself. See the description in the PreferredPlacement documentation.

    There is more flexability when launching other apps in Windows 8.1 Preview. See the new DesiredRemainingView property.

    --Rob

    • Proposed as answer by Michael Osthege Sunday, August 4, 2013 7:51 AM
    • Marked as answer by Anne Jing Thursday, August 8, 2013 7:41 AM
    Sunday, August 4, 2013 1:14 AM
    Moderator

All replies

  • This is not possible in Windows 8. Apps cannot explicitely snap themselves. Only the user can. The PreferredPlacement property refers the Open With or Placement dialogs which may be shown when launching an app, not the launched app itself. See the description in the PreferredPlacement documentation.

    There is more flexability when launching other apps in Windows 8.1 Preview. See the new DesiredRemainingView property.

    --Rob

    • Proposed as answer by Michael Osthege Sunday, August 4, 2013 7:51 AM
    • Marked as answer by Anne Jing Thursday, August 8, 2013 7:41 AM
    Sunday, August 4, 2013 1:14 AM
    Moderator
  • In 8.1 you can use a new API to show PDFs in your app - without interaction though.

    Code Sample -> http://code.msdn.microsoft.com/PDF-viewer-sample-85a4bb30


    Life is unsure - always eat the dessert first!

    Sunday, August 4, 2013 7:53 AM