Feb 172014
 February 17, 2014  Posted by at 8:02 am WinRT  Add comments

LauncherOptions has several neat properties that lets us configure the launch for a better user experience. You might for example want the user to use a specific application, and suggest that they download it if itโ€™s not installed. This is done with:

PreferredApplicationDisplayName and PreferredApplicationPackageFamilyName

If you want the user to select from a list of applications that have registered for the file type you can use:



Another cool feature, which my friend Jonas showed me, was:


One of the most exciting features of Windows Store Apps is for me the ability to run applications side by side. Not so surprisingly you can therefore launch a target application to for example open a specified file, pushing your application to the side in medium or minimum mode, and having the other application take up the remainder of the space. This is done with DesiredRemainingView.


These are just small tweaks that add to the overall user experience, but all the small things here and there add up, and helps us deliver better applications that our users want to use- and enjoy to use.

Make sure you add some thought to how you launch files in applications, and use the LauncherOptions object.

Code example:


[sourcecode language=”csharp”]
using System;
using Windows.Storage;
using Windows.System;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;

namespace SnapToSide

public sealed partial class MainPage : Page
public MainPage()
SizeChanged += OnSizeChanged;

private void OnSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventArgs)
VisualStateManager.GoToState(this, sizeChangedEventArgs.NewSize.Width <= 320 ? "Small" : "Default", true);

private async void TextBlock_Tapped(object sender, TappedRoutedEventArgs e)
var pdf = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///file.pdf"));

new LauncherOptions
DisplayApplicationPicker = true,
DesiredRemainingView = ViewSizePreference.UseMinimum


[sourcecode language=”xml”]

<Grid Background="#FF2E3B46">
<RowDefinition Height="auto"/>
<TextBlock x:Name="textBlock" Text="PDF Viewer" FontSize="65" Margin="20,50" HorizontalAlignment="Center" TextWrapping="Wrap"/>
<TextBlock x:Name="textBlock1" Grid.Row="1" Text="Open pdf and snap to the side" FontSize="65" Margin="20,50" Foreground="orange" HorizontalAlignment="Center" Tapped="TextBlock_Tapped" TextWrapping="Wrap"/>
<VisualState x:Name="Small">
<DoubleAnimation Duration="0" To="32" Storyboard.TargetProperty="(TextBlock.FontSize)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
<DoubleAnimation Duration="0" To="32" Storyboard.TargetProperty="(TextBlock.FontSize)" Storyboard.TargetName="textBlock1" d:IsOptimized="True"/>
<VisualState x:Name="Default"/>

Images in case code examples get messed up in the future ๐Ÿ™‚





 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



What is 7 + 6 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)