Activating Windows 8 contracts in your app


One topic that we’ve demonstrated quite a bit is how apps on a Windows 8 PC can communicate with other apps and web services.  At the start of Windows 8 we chose an approach where apps can be the source or destination for data you want to share—sort of like a clipboard, but with a richer interaction model and clearer semantics. When an app implements a contract, Windows 8 can provide glue between that app and any other apps on the system, and the system itself. You can see this in action when you do something simple like use the Share charm from a web page in the Metro style Internet Explorer—you can share the link via the Mail app, with someone whose contact info you’ve stored in the People app, and so on. You can search across apps that implement the Search contract. You can open and save files from or to any location that implements the File Open and Save Picker contracts. This innovative approach allows Windows 8 to work with any app/service pair rather than “hardcoding” a single level of support for a given app.  And all of this is supported, if you choose, by your Microsoft account, which you can connect to different services, from Facebook to Twitter to LinkedIn and more.  Over the course of this week, we’ll do a series of posts on the new Microsoft apps, where sharing, connecting, and integration with Windows 8 are key topics. This is a repost of a developer-focused post from our Windows 8 App Developer blog and was authored by Derek Gebhard, a program manager on our User Experience team. –Steven


When you start writing Metro style apps you’ll quickly come across contracts, a new and powerful concept in Windows 8. Metro style apps use contracts to declare interactions they support with other apps and with Windows. You’ve probably already heard about some of them: search, share, etc. Using contracts, apps become better by working with the system or with each other when users install more apps that implement contracts. In this post I’ll walk you through activation, one of the main concepts to think about as you add contracts to your apps.

The Windows activation platform is used to launch Metro Style apps and to notify them of the reason why a user launched them. The reasons vary from a user starting the app using its tile on the start screen to the app being launched for a specific task such as showing a user search results for a query. Windows provides your app with the reason it was launched and if applicable any additional info needed to complete its task. Before our Windows 8 activation platform, you passed this info to apps via command-line parameters. With our new model, we also support passing live objects such as a StorageFile, ShareOperation, etc to provide the app with context. You’ll see that this makes contracts all the more powerful. Let’s jump into the details of what you need to know to support being launched for a contract.

Contracts: Launching Metro style apps for a purpose and with context

As you can see in the Windows 8 Consumer Preview demo, Windows 8 contracts are the glue that binds your app to other Metro style apps and to the system UI. For example, the File Open Picker contract allows the user to import files from one app into another. With the Search contract, users are empowered to search an app from anywhere in the system and can quickly transfer a query between multiple apps. In all of these cases, and a lot of other contract scenarios, Windows needs to be able to launch directly to a spot in your app’s UI where the user can complete a specific task quickly and efficiently. This is where our activation platform and API come into play.

Users initiate app interactions in one of two ways:

    1. Through an action that requires the app’s fully immersive view to be in the foreground. This is also called main view activation. An example is the Search contract.

      Clicking on an app in the Search pane launches the app to its search results view.
      Example of main view activation
    2. Through an action that is hosted inline, without leaving the context of the currently running app. This is also called hosted view activation. Here are two examples, an app participating in the file picker and an app being used as a Share target.

Selecting an app in the Picker launches the app’s UI where the user can select a file.
Example of hosted view activation in the Picker

Launching the Mail app via the Share charm to share the photo I am interacting with.
Example of hosted view activation for Share targets

The differences between these two are:

Main view activation

Hosted view activation

Is fully immersive and launches as the main app on screen

Renders UI within system chrome

Can be used for potentially many different tasks

Is used for a short, directed task and code is focused solely on this task

Appears in the switch list

Never shows up in the switch list

Can be closed via the close gesture

Doesn’t change the view of the main window for the same app

So let’s look at these activation models and apply them to a couple of common scenarios that will help you build your great Metro style apps.

Scenario 1: Integrating Search activation in your app

In Windows 8, adding search through the Search contract lets users search your app’s content from anywhere in their system at any time. If your app is the main app on screen, users can search its content immediately by using the Search charm. Otherwise, users can select the Search charm and then pick your app from the list of apps in the Search pane to search it.

Supporting Search activation means that your app can be launched at any time to show search results for a specific query. Just like being launched from the start screen, being launched from the Search pane falls under main view activation. So, if you support multiple contracts, your app can potentially be activated for many different scenarios. In addition, your app could end up receiving this activation when it is already running, because a user may want to repurpose your main view to handle a specific scenario like showing search results. To make this work, I recommend that you:

      • Delay loading of your code that isn’t essential to the main view contract your app is activated to handle.
      • Separate your general initialization logic that you use for all contracts from the logic that needs to be run for a specific contract.
      • Ensure that any code expected to run only one time at launch isn’t added into your activation handler in such a way that it can execute multiple times.
      • Reload any previous state and settings when being launched from a terminated state so that your app appears to the user as always running and connected.

Check out the Store and Photos apps. They do a great job of following these recommendations when supporting Search activation.

The Store app is shown with search results for "calendar". Search pane is open and user is entering a new search query.

Search in the Store app

 

The Photos app is running and showing search results for Vancouver. The Search pane is open with a submitted search query for "vancouver".

Search in the Photos app

Let’s take a look at how you can support Search activation properly in your JavaScript and XAML apps.

JavaScript apps

For JavaScript Metro style apps, activation is exposed through the WinJS.Application.onactivated event. This event is fired after DOMContentLoaded completes if the app isn’t already running or isn’t suspended. Otherwise, the event is fired as soon as Windows needs to activate the app. Visual Studio tooling for JavaScript apps takes care of setting up this event registration in default.js and provides an area where you can add code that will run when a generic launch activation occurs, that is when the user launches your app from the start screen.

To extend support for Search activation in your app:

      1. Add the Search declaration to your manifest using the Visual Studio Manifest Designer.
      2. Place in your JavaScript’s global scope any general initialization code that needs to run every time your app is started irrespective of the reason. If any of this code needs to access the DOM, add the code in a DOMContentLoaded event handler.
      3. Register to handle being activated for Search.
      4. When your app is activated for Search, navigate to your search results page and pass in the queryText you get from the activation event arguments.

If you are like me, you are probably looking for an easier way than doing this manually. Fortunately you can use Visual Studio tooling for completing most of this by right clicking your project, selecting Add > New Item, and choosing Search Contract in the dialog. Most of the code you see here, and a search UI that displays results in a way that follows our search ux guidelines is automatically created for you. But you must use the WinJS.Navigation framework with this tooling.

Here is a code snippet from my photo app’s default.js file that shows support for Search activation:

// Register activated event handler
WinJS.Application.addEventListener("activated", function (eventObject) {
...
if (eventObject.detail.kind === appModel.Activation.ActivationKind.launch) {
...
} else if (eventObject.detail.kind === appModel.Activation.ActivationKind.search) {
uri = searchPageURI;
pageParameters = { queryText: eventObject.detail.queryText };
}
// Indicate to the system that the splash screen must not be torn down
// until after processAll and navigate complete asynchronously.
if (uri) {
eventObject.setPromise(ui.processAll().then(function () {
return nav.navigate(uri, pageParameters);
}));
}
});

XAML apps

For XAML Metro style apps, the Windows.UI.Xaml.Application class does a lot of the work needed for your app to support activation. This class exposes a set of strongly typed activation methods that you can override for supporting common contracts such as Search. For all contract activations that don’t have a strongly typed method, you can override the OnActivated method and inspect the activation kind to determine the contract for which your app is activated.

New XAML app projects in Visual Studio come with generated code that uses the Windows.UI.Xaml.Application class to make the app capable of being activated for a generic launch. The code for handling this activation is in the class representation for your app, found in the App.xaml.cs/cpp/vb files.

To extend support for Search activation in your app:

      1. Add the Search declaration to your manifest using the Visual Studio Manifest Designer.
      2. Place in the App constructor of App.xaml.cs/cpp/vb any general initialization code that needs to run every time your application is started irrespective of the reason.
      3. Override the strongly typed OnSearchActivated method in App.xaml.cs/cpp/vb to handle search activation.
      4. Load your Search UI and show search results for the query you receive in the SearchActivatedEventArgs.

Again, just like for JavaScript apps, there is an easier way than manually doing this work. You can use Visual Studio tooling for completing a lot of this work. Just right click on your project, select Add > New Item, and choose Search Contract in the dialog. Most of the code you see here, and a search UI that displays results in a way that follows our Search UX guidelines is automatically created for you.

Here are snippets of C# code from my photo app that shows support for Search activation.

We must override the OnSearchActivated method to support activation for Search:

protected override void OnSearchActivated(SearchActivatedEventArgs args)
{
// Load Search UI
PhotoApp.SearchResultsPage.Activate(args.QueryText);
}

The Activate method of the SearchResultsPage sets up a UI that shows search results for the user’s search query:

// SearchResultsPage.xaml.cs code snippet 
public static void Activate(String queryText)
{
// If the window isn't already using Frame navigation, insert our own frame
var previousContent = Window.Current.Content;
var frame = previousContent as Frame;
if (frame == null)
{
frame = new Frame();
Window.Current.Content = frame;
}
// Use navigation to display the results, packing both the query text and the previous
// Window content into a single parameter object
frame.Navigate(typeof(SearchResultsPage1),
new Tuple<String, UIElement>(queryText, previousContent));
// The window must be activated in 15 seconds
Window.Current.Activate();
}

The logic and principles showcased here don’t just apply to adding Search activation support. You can use the same techniques when adding support for Protocols, File Associations, and Device AutoPlay as these are also main view activation contracts.

Scenario 2: Integrating File Open Picker activation in your app

A Metro style app can call the file picker to let the user browse their system and pick files or folders for the app to operate on or to let the user save a file using a new name, file type, or location (“Save As”). Apps can also use the file picker as an interface to provide other apps with files, a save location, or even file updates. By incorporating the File Open Picker contract, you can help users pick files from your app directly within another app. Users gain freedom and flexibility to choose files that your app stores and presents.

Launching an app for the File Open Picker contract falls under hosted view activation. The app’s UI is hosted inside of the file picker and the code that runs for this activation must be solely focused on the task of enabling users to pick their files. It is important that your app is as fast as possible here to give users a great experience. Don’t load any code or libraries that are unnecessary for the specific hosted view activation task.

I recommend looking at the SkyDrive app because it is a great example of supporting File Open Picker activation and focusing solely on the task of allowing users to pick files.

The Picker is running and allowing the user to pick a file from their SkyDrive app.

File Open Picker support in the SkyDrive app

Let’s take a look at how you can support File Open Picker activation properly in your JavaScript and XAML apps.

JavaScript apps

For JavaScript Metro style apps, the hosted view activation behaves the same as main view activation, except for one key difference: hosted view activation always occurs in a new window and script context. This means that your code for handling this activation can’t access libraries, global variables, or the DOM of your main app.

To extending your app to support File Open Picker activation:

      1. Create a new HTML page that is specifically designed to handle only the File Open Picker contract.
      2. Add the File Open Picker declaration in the Visual Studio manifest designer and specify the newly created HTML page as the start page.
      3. Load only JavaScript and other resources in this page that are necessary for supporting the File Open Picker contract to improve performance.
      4. Structure the activation event handler to handle only activation for the File Open Picker contract. This handler is called only once during the lifetime of the file picking task.
      5. Use the activation event arguments to interact with the file picker.

To save time you can you use Visual Studio tooling for completing this work. Just right click on your project, select Add > New Item, and choose File Picker Contract in the dialog. Most of what you see next is automatically created for you in your project.

Here is a code snippet from my photo app’s fileOpenPicker.js file for handling File Open Picker activation:

// Register activated event handler for handling File Open Picker activation
WinJS.Application.addEventListener("activated", function (eventObject) {
if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.fileOpenPicker) {
pickerUI = eventObject.detail.fileOpenPickerUI;
pickerUI.onfileremoved = fileRemovedFromPickerUI;
...
}
});

WinJS.Application.start();

XAML apps

For XAML Metro style apps, you support hosted view activation in your app similarly to main view activation. The biggest difference is that now your app must create a new thread and new window to handle the activation. The Visual Studio template code handles all of the work to create the new thread and new window on your behalf for hosted view activations.

To handle File Open Picker activation a XAML app must:

      1. Add the File Open Picker declaration to your manifest using the Visual Studio Manifest Designer.
      2. Override the OnFileOpenPickerActivated method in App.Xaml.cs/cpp/vb and load your page that will handle this contract.
      3. Pass in the FileOpenPickerActivatedEventArgs to the page handling this contract so that it can interact with the file picker.

To save time you can use Visual Studio tooling for completing this work. Just right click your project, select Add > New Item, and choose File Picker Contract in the dialog. Most of what you see next is automatically created for you in your project.

Here is a snippet of C# code from my photo app for handling File Open Picker activation:

// App.xaml.cs code snippet
protected override void OnFileOpenPickerActivated(FileOpenPickerActivatedEventArgs args)
{
var fileOpenPickerPage = new PhotoApp.FileOpenPickerPage();
fileOpenPickerPage.Activate(args);
}

// FileOpenPickerPage.xaml.cs code snippet
public void Activate(FileOpenPickerActivatedEventArgs args)
{
this._fileOpenPickerUI = args.FileOpenPickerUI;
this._fileOpenPickerUI.FileRemoved += FileOpenPickerUI_FileRemoved;

// Show the user’s photos in the Picker UI
...

Window.Current.Content = this;
// The window must be activated in 15 seconds
Window.Current.Activate();
}

The logic and principles showcased here don’t just apply to adding File Open Picker activation support. You can use the same techniques when adding support for Share Target, File Save Picker, Contact Picker, Camera Settings, and Print Task Settings as these are also hosted view activation contracts.

In closing

I showed you how Search, File Picker, and other Windows 8 contracts offer the ability to drive users to your app for completing a specific task from other parts of the system and even other apps in certain scenarios. Users will expect these experiences in your app are fast and fluid because Windows and your app are both aware of their intent and the task they are trying to complete. Implementing your app activation correctly is core to creating a great experience for these contracts. Even if you are just working on the core of an app and are not using any contracts, it is good to keep these tips in mind as you set up your generic launch activation. This way you can easily extend your app in the future to support contracts without refactoring your code.

Things to remember:

      1. Place any general app initialization logic in a location where it will be executed independent of how your app is activated.
      2. Your activation handlers can be executed even when your app is already running or is suspended. Make sure this can’t cause any unintended consequences for your app.
      3. Visual Studio tooling can do a lot of the work for you to support the Search, Share Target, and File Open Picker contracts. All you need to do is right click your project and select Add > New Item.
      4. When receiving a hosted view activation, load only the code necessary for the task associated with the activation.

To learn more about activation and contracts in Windows 8, you can follow these links or ask questions in our forums:

Documentation

Samples

Thanks,

Derek Gebhard
Program Manager, Windows User Experience

Contributions by: Jake Sabulsky, Marco Matos, Daniel Oliver

Comments (88)

  1. 600p says:

    great dev info, maybe soon I will create a metro app too :)

  2. jader3rd says:

    What's the keyboard shortcut for bringing up the search contract within an app?

  3. QuesoLoco says:

    @jader3rd

    Win + Q (query) is the shortcut for search, it defaults to the current app, or the apps list if you're on the start screen

  4. jader3rd says:

    @QuesoLoco,

    Thanks. I thought so, but it didn't seem to work. Perhaps the problem was that I was trying to search in an app that didn't implement the search contract.

  5. zammbi says:

    Any java support?

  6. The "hosted view" for the email application when sharing files by email is extremely annoying. If I type a lengthy mail message, if I click outside the "hosted view" by mistake, it automatically loses my composed email.

    So during the share contract activation of the Mail app, MY computer is taken hostage by the email app.

    I'm not allowed to do anything with MY computer, intentionally or accidentally, like trying to copy a quote from another app and paste it in the email, or typing a quick reply in the messaging app, until I finish composing the email, or I will lose the email.

    At the very least, there should be a "save as draft" button in addition to the "send" button in the hosted view. Even better, automatic auto-saves of the partially composed email should be done.

    Or a button in the hosted view that switches to full view, to be able to switch between apps without losing my partially composed email.

    But what am I saying, you still didn't fix the "lose comments" "feature" of the MSDN blogs after all the years of complaints, why should I expect you to fix the "lose emails" "feature" of the hosted view for the Mail client, when you didn't even release the final version yet.

    Hopefully by 2020 you will fix both issues.

    Oh, and since you didn't allow comments anymore on the "Building a rich and extensible media platform" post less than 12 hours after posting it, I feel the need to repost one of my comments from the IE Blog here, although is off-topic here and would have been more relevant on the post that doesn't allow comments anymore:

    WTF Microsoft? You have broken Flash full screen support in IE10 Release Preview.

    If you start a Flash video in a middle of a long article and go full screen, when you exit full screen, the containing page scrolls to the top, and you lose your reading context. This also happens for HTML 5 video, on both IE Desktop and IE Metro. This didn't happen on Windows 8 CP with standalone Flash.

    Most annoyingly, you have broken multi-monitor support for full screen flash. I like to watch Formula 1 races on my 47" TV, connected through a HDMI cable to my laptop.

    I run a full screen Flash video stream of the Formula 1 race in a IE browser window on the TV. And I use the integrated display of the Laptop with another IE window, to watch race statistics/live comments/etc.

    What happens now is that, if the Flash video runs full screen on the TV, as soon as I click anything on the integrated laptop display, the Flash video exits full screen mode. This happens both on Metro IE and Desktop IE, and also for HTML 5 video. This didn't happen on Windows 8 CP with the standalone Flash.

    Because of this, I also cannot run two full screen flash videos on my two displays. As soon as I click the full screen button on one video, the other video exits full screen, and so on. Maddening.

    Because of this I had to use Google Chrome to watch Formula 1 this weekend. But even there, Windows insisted displaying the taskbar over the full-screen flash video. I read that has something to do with my DPI being set to 125% and Chrome (or Flash) not including a high-dpi manifest, or something.

    Either way, all this needs to be fixed. For the first time since IE7, I'm seriously considering giving up IE if this is not fixed until the final release.

    Furthermore, for Metro IE, the audio pauses when you play audio/video and you switch to another application. This sucks. I know Metro pauses applications when not in foreground. That sucks. That should only be the default, and we should be able to override it for specific applications, or, talking about IE, maybe even for specific sites.

    Also, since the Mail app loses emails, the MSDN forum loses blog comments, what could IE 10 Metro do? Of course, it loses tabs. If you open 11 tabs, since it supports only 10, the first tab is automatically closed, without any warning, and you lose any work you might have been doing in that tab.

    How anyone could think that is a good idea, is beyond me.

  7. Ocram Sotam says:

    What are the security benefits, if any, of the contract model to control interaction between Metro apps?  What are the types of threats these security benefits are designed to mitigate?  Thank You

  8. @jader3rd

    Win+Q should always work. If you're in an app which doesn't support the search contract, you should still see the search charm come up with a message that says "This app can't be searched." From there you can choose to search any other scoped (i.e. Apps/Settings/Files or any app supporting the contract).

  9. Doug says:

    Does anyone else skip Steven Sinofsky's opening paragraph in every post or is it just me?  The blog posts are great! The intros, not so much.  But don't stop now Steven, not on my account anyway.

  10. Tor says:

    I don't like metro, please remove METRO!… +1

  11. Xero says:

    We need our favorites/bookmarks to roam across all platforms: connect.microsoft.com/…/sync-favorites-with-skydrive

  12. Kramayp says:

    I don't know why I can't seem to comment on the "Building a rich and extensible media platform" post so I'm just going to voice my opinion here.

    I think that every time a person chooses to play a media file like a movie or a song in the desktop environment of windows 8, they sholud be able to spontaneously (well, relatively quickly) listen to their music quickly without the music / video app having to load and sign you in and so on. You should develop a fast launch mechanism which only loads up the code required to play the video or song when the app is opened indirectly (i.e – via opening a file, not the app itself) – This would be something like media player where there is a play mode which does not load the entire media player but just a player which loads up relatively quickly. I think that would make a world of difference for media users.

    Also, the music app looks gorgeous btw!

  13. And Skype will come by default in Windows 8? It was very good.

  14. sevenacids says:

    This is a repost? Nothing interesting to tell anymore as the building winds down?

    Nice feature, by the way. The concept reads like borrowed from the Singularity research project.

  15. pmbAustin says:

    @SubaDog2011, that article really does make the case for baking in Silverlight, even if they do want to kill it… because even if they go around and fix ALL their websites to work with IE10-Metro, that doesn't mean every other site on the internet will.  And if they really want to push the whole "It just works" and "No compromises" thing, then I'm at a loss to imagine how they'll manage that, with all these issues.

    Of course, the baked in "Flash" hasn't worked out so well… videos that used to play in IE10-Desktop with the Flash plugin installed no longer work correctly… you get sound only but the picture is just a plain white background.  So RP has broken something that worked in CP.

  16. W2K12User says:

    I've been using W8CP, W8RP, and now I recently installed the release preview of Server 2012 and believe it or not, it's blazingly fast – feels real 'fast and fluid', when compared to W8CP/RP.

    After spending a few hours on Server 2012, I couldn't help but feel that very soon Microsoft may no longer be relevant in the desktop/tablet market, but admins who upgrade to Server 2012 will be very happy with the new 'fast and fluid' servers.

  17. pure says:

    Please, Mr. Sinofsky, would you be so kind to explain how you would present the usability benefits of Windows 8 over Windows 7 to customers of non-touch-enabled devices, like desktop and notebook computers? Tell me, how would you convince me to choose Windows 8 over Windows 7? What feature(s) make it so special and what tasks can't be done with Windows 7 on a mouse/keyboard-based machine?

  18. farmington says:

    I'm still trying to wrap my head around contract. How flexible are they? For example, I would like to implement an image processing app that implements an image processing contract. The contract defines a method whereby another app can send an image to my app for processing and, when complete, my app can return a process image (or multiple derivative images) as well as some metadata about the processing that was performed. Control can then return to the caller app. Is that something that can be done with Windows 8 contracts?

  19. farmington says:

    Oh, and I want to throw in a vote for baking in Silverlight. Windows own help pages (linked to by Windows 8 itself) don't play in Metro IE10 because of the lack of Silverlight. It's only 6MB. Just bake in Silverlight 5.1 and everyone will be happy.

  20. ferdinand says:

    @Microsoft

    you are best :)

    we had to work with Command Prompt  in Windows 8 like to MS DOS.

    thank you very much :)

  21. Rafael says:

    [FROM BRAZIL]

    If the taskbar icons are large and have no text, why not do the same with the desktop applications pin at the start?

  22. Metroidism Metro Metroooo Meeeeetro says:

    EW Metroism

    I DON'T LIKE METRO

  23. Ankur Patel says:

    Appreciate if you can share similar details on how to differentiate between top and bottom Navigation bar what's the concept of having 2 and what goes where as have seen several different uses of it in various preview apps…any specific recommendations/guidelines?

  24. Ankur Patel says:

    I know that we have great new features around parental controls however some of these devices are actively used by kids/toddlers and we would sometimes have them locked down to specific experience versus being worried about they tapping unwanted shortcuts/settings unknowingly.. Any ways this can be achieved in Windows 8?

  25. Jerry Bacon says:

    @pmbAustin, yeah I agree.. "No compromise" is a joke.. If they are so serious about porting IE to so many form factors (tablet, phone, pc, laptop and now XBox -http://www.xbox.com/…/smartglass), they should have taken the existing issues seriously and address them in IE10. IMO, IE10 will only cause problems in new form factors. That IE's memory-flash bug from the other day is an example. I'm not sure how the XBox version of IE10 would react in case of power loss. The OP can't produce this issue in FF. I can't reproduce this issue in Chrome and Safari either. And since the genius IE team at Microsoft never faced the abrupt power loss, they don't care much what consumers are been through…

  26. alvatrus says:

    Metro makes a lot of sense for data consumption (internet, movies, photos, social, etc.). Actually, I can see it's rather great for that. For data creation however, not so much. That's the realm for the desktop.

    If Microsoft would just leave out the metro-elements on the desktop (how many time has the charms-bar popped up, or sent me to the start-screen when hunting for the desktop-ie back button.) then I would be perfectly happy with that.

    I wouldn't mind going to the start-screen for launching new apps. I do mind the useless clutter of metro on the desktop, however.

    Why can't Microsoft use the windows-key as a toggle between the two interfaces, and let the user be completely in control. No inadvertent switching between desktop and metro, and no UI on the desktop that makes no sense in that context.

    Just that very small change that lets me be totally in control that fits my activities would make Windows 8 really great. I love the way metro has simplified casual computer use. I think the improvements for the desktop are great. Just don't mix them together.

  27. Waqar Amjad says:

    @Jerry Bacon, @pmbAustin,

    Here is a story: We have a small setup in Pakistan. We managed to compile a large volume of documentation (like over 10k books) in XPS format back in 2007. We have printers specialized for XPS documents. We were under the impression that keeping all the material in Microsoft Office family format would someday/somehow give us advantage over PDF. One day, I bought a Windows Phone device and subscribed to Windows Live SkyDrive. Guess what? there is no way to access the XPS files in either of the platforms! SkyDrive has 'View Online' option for PDF but not XPS. Windows Phone has many PDF reader apps but not XPS. I tried to develop the XPS reader app in Silverlight for WP, but I am stuck as there is no comfy way to convert XPS's XAML to Silverlight-for-WP's XAML (and I encountered number of pitfalls in that approach). I asked Microsoft, if they have abandoned the format, all I hear is.. "At this point, we don't have plans to look into XPS..". Furthermore, Windows 8 Metro apps have no support for XPS either. They discontinued the format silently and secretly. Even MSFT's own technical docs are only available in PDF on MSFT Download Center website (with used to have XPS files alongside).

    Moral of the story: Today what Microsoft is calming to be their favorite and emerging platform would soon be forgotten and buried under the ground by themself. They won't recognize it and won't even talk about it.

    Similarly, Silverlight for web being Microsoft own platform, Microsoft would merrily murder that format like they did to XPS.  Windows Phone and Windows 8's metro are built to run Silverlight apps but they don't allow IE-Metro to run Silverlight for web. That would probably break the revenue-lifecycle of the Windows Store of WP Marketplace. That's the reason Apple don't allow first-class Flash support and that's why Microsoft hasn't allowed it in WP. The Windows 8's limited Flash support in metro IE (only for sites in compatibility list) is eyewash.  Either that or they have some kind of undisclosed terms with Adobe which renders them to waste their products…

  28. neko says:

    Please Microsoft. Make Metro optional and allow traditional Start Menu if user choose to use it. Do not force to use Metro on desktop PC. Please, listen your loyal customers.

  29. Fleet Command says:

    @neko: I am afraid they likely won't. Windows 8 is now at Release Candidate stage, meaning that you are seeing what you are going to get. If you don't like it, well, join the club.

  30. The fact that the search box can be used by other applications is too subtule.

    I only realised after reading the post, that i can use the search box (from the charms) in the dictionary app to find a word.

    all this time, from the start of consumer proview.. i was cursing the Dictionary app as i did not know how to  look up a word.

    please make that search box sit on the start screen.. instead of activating it by charms.

  31. Ed says:

    @alvatrus

    I agree, but maybe Microsoft will find a way to make it work…

    They deserve the benefit of the doubt…

    Hope its not Me 3.0

  32. MedotName says:

    cool and all, but still looks ugly….

    I LOVE the new Visual Studio color schemes, including the color shadow/glow…

    But, can we remove the CAPS? NOBODY LIKES YELLING.

  33. Eli says:

    there are any improvements in voice rcognition? for example like dictation in mac os x 10.8, or something like siri?

  34. There needs to be improvements says:

    Voice Recognition suggestions

    Works with every mic

    1. More Commands

    This is some Ideas

    - Open Start

    - Open Internet Explorer

    - Open Notepad

    -  Shutdown

    -  Restart

    -  Log Off

    -  Switch User

    -  Sleep

    - PC Settings

    - Open Windows Explorer

    -  Show Desktop

    Like what it is on the Xbox Dashboard when you have a Kinect, but not make it only for Kinect for Windows have support for all mics.

  35. WndSks says:

    Why are desktop apps not allowed to participate in the sharing/contracts ecosystem? Because you are killing the desktop?

  36. Agrees with Raphael says:

    Yes. It's easier to memorize and distinguish an app with an icon rather than text (new taskbar, anyone?) so why can't you implement the same to desktop shortcuts in Start screen? I know you want to distinguish a metro app from a desktop app but all shortcuts in Start should have a unified look that is icons rather than texts.

  37. Aki says:

    Metro can never achieve the multi-tasking ability of desktop. Desktop is here to stay.

  38. metro metro metroooooooooo says:

    Metro sucks on Desktop! +1

  39. Metro needs to get out of Windows 8 for Desktop.

  40. Guys, I don't think Microsoft will ever allow contracts for desktop apps or fullblown desktop shortcuts in the start screen – Microsoft is actively moving away from Desktop (notice how all the new video/playback enhancements are Metro-only) and I don't think they see any value in making the desktop side any easier to use or more integrated with Metro.  I really think that Microsoft decisionmakers feel that desktops are on their way out and the future is laptop/tablet/pad, they will keep "legacy" support for the desktop (just like the command prompt) but will not spend any programing dollars in enhancing it.

  41. MarkB says:

    @Vlad NC – your experience is typical of my own. The Metro apps are so restricted in what they do and the way they do it that I have yet to find one worth keeping. Try using the picture app to display 5 pictures in a non-standard location, try using the News app to show non-Bing news, try using the mail app to block picture downloads from untrusted domains.. I am sure that the next generation of users will happily live within the narrow restrictions and automatic linkages that Metro provides, for me Metro will be used for very little other than a start screen.

  42. Kris says:

    Hi steven, Can you answer me these thing regarding windows 8.

    I have seen too many bugs in Rc. Is this means buy Win8 or Die. I see a homegroup icon are appear without doing nothing. the issue is they are show forward the folder I have created. If you move them they are work fine.

    I want windows classic (look of 98). can you make me sure that I will got it on w8.

    Is server version allow user to run metro apps on server.

  43. Windows 8 = Windows 7 + Metro + some improvements says:

    Metro is nice, but apps tiltle fonts are too big, i can't see anything

  44. Kill Metroidism says:

    Metro sucks on Desktop! +2

  45. Yama Jama says:

    Metro sucks on Desktop! +3

  46. Metro Racism says:

    Leaving metro on Windows 8 is racist.

  47. Camay says:

    Metro sucks on Desktop! +9875324567453425

  48. I second @Vlad NC, I've also encountered those issues. Nothing more frustrating than losing your work, even if it's just an email sharing some pictures. Users should expect to be able to switch back to the app and have the hosted view exactly as they left it.

    Related to that, how can users contribute to usability feedback as in this case?

  49. Touch Touch Touch says:

    http://www.youtube.com/watch

    Cause Windows 8 is made for TOUCH!

  50. Windows 8 sucks says:

    There are some trolls here…. trolls go away!…

  51. Xero says:

    In IE (any version), if you click in the middle of some text and press-and-hold Shift and click within that word, it would select the letters from the first click till the last click.

    Like in word "Microsoft", if your first click was between 'c' and 'r' and second click (while holding Shift key) between 'f' and 't', it would highlight 'rosof'.

    Now, if the second click is performed beyond the current word boundary, it will move the location of first click to at the start of the word boundary (or at the end, if second click is performed backward) in case the click took place somewhere in between the word.

    For example, in the sentence "Microsoft is a software giant.", if your first click was between 'c' and 'r' of word "Microsoft" and second click (while holding Shift key) was performed after the letter 'g' of the word "giant", it would highlight 'Microsoft is a software giant' instead of 'rosoft is a software g'

    FF doesn't have this issue. Please remedy it.

  52. @Scripticus

    You can't create random contracts (like your image processing contract).  The contracts are defined by the api and handled by windows which is why they are so flexible (I can combine functionality without the other apps having to even know mine exists).  I imagine more contracts will be added as the metro sdk and api's mature in future releases.

    However, I think it is possible to do what you want with current contracts (specifically the file picker contract).  I have not tried this operation, but I think it would work.  When I'm in an app that needs an image (a facebook or twitter app for example), I use the file picker and select your app.  Your app shows me pictures from my picture library that I can select.  I pick one and your app (still in the file open context) shows filter options for the image.  After I select the filters I click open.  Your app performs the modifications, saves the file, and returns to the original app a reference to the new modified file.

  53. MetroPorn says:

    Can I watch porn in Windows 8?

  54. Moderator says:

    This blog post is addressed to the developers. Microsoft personnel, please restrict the comments for signed users only and turn on moderation tools (flag, vote etc) to keep the comments readable and productive.

  55. Customer says:

    @Moderator

    Is there any way to remove Metro? Please, I don't like the metro experience.

  56. StevieBallz says:

    @JHawk111, Scripticus

    Actually you can pipe custom data through the Share Contract. If they are not defined by the ContractObject itself (like Text, URL, Image, etc.) you can add custom data but have to define a kind of ID-code (I guess the best way to do that would be to use the MIME-Type). Any other App that supports that ID-code can then consume it. This might be necessary for custom Image formats. For regular Bitmap images there actually is support in the Share-Contract but as that was only an example given by you the more general answer is above.

    What I don't know if there is an easy way to get the edited data back to the original App without using the FilePickerContract.

  57. Jason Brown says:

    85 dollars per license on ARM? Are you nuts?

    How much will ARM tablets cost to consumers then?

  58. Adam says:

    Metro sucks on Desktop! +1

  59. European Boy says:

    Mountain Lion for Mac will only cost $19.99 that is €15.99.

    Windows 8 will cost too much.

  60. 85 $ to OEM, how much it costs to customer that already have a Tablet?

    Remember than on Android tablets, that are very cheap and good performant, there are already most of windows programs ported, so give us a very good publicity and reasons to buy a new nearly 800 euros tablet???

    On RT just metro Apps??

    Before you are going to sell it, you have specifically say this, no standard programs compatible on it, otherwise a big legal sue is on the way……

    So big price, no standard windows program????

    That makes you loose big part of the Tablet market, these days are very hard in Europe, average joe will not spend too much money for a tablet!!

  61. mgriffiths says:

    Am using Win8 all day 9to5 and I really do love it.

    BUT… Desktop and Metro still feel like 2 naughty children who have crossed their arms and refuse to talk to each other and every now and then stamp on each other's toes!!

    … Desktop and Metro could so easily work together a lot better. As it is, I feel that because Metro doesn't work very well with desktop you're getting all this negative feedback, if metro and desktop worked better together, people who want/need mostly desktop would be a lot happier.

    Some examples…

    The Share contract:

    -Are you really sure you don't want to be able to share between MS office (or other desktop apps) and any metro app I'm sure you could enable the share contract for non-metro apps. Keeping them so separate is to the detriment of the whole OS.

    I'm sure with the right APIs you could make desktop apps able to support Share, Settings, Devices etc…

    To switch apps:

    …Whilst working in Metro, you have to use the left hand bar, all desktop apps are bundled into a single "desktop" item.

    …Whilst working in desktop, you use the task bar.

    The task bar and left hand bar do the same job, if we really must have 2 separate equivalent things to do the same job, why not at least make them work consistently, why not enable the left hand bar to switch between all the individual desktop apps? Also why not let metro apps show in the task bar? Seems obvious to me.

    As I'm navigating around windows 8 it's making me think which task switcher to use to get back to where I was before… and we all know that its only a bad UI that forces you to stop and think.

    For example I had the mail app open on my 2nd screen, then clicked a task bar desktop icon on my 1st screen and the mail icon disappeared it took me about 10 seconds to figure out how to get the mail app back!!!

    Personally if the option was available to have the task bar display "everywhere" in metro apps as well, I would turn it on, just so I could have a single way of switching between apps. The lost screen real-estate isn't an issue for me.

    I actually think the task bar would have been just perfect for touch (Icons are big enough).

    Alt+tab in Win8 is a good implementation it just works as you expect with no "jarring" effect I hope the rest of windows can catch up at some point.

    it's easy to see the 9-5 office worker, non-touch, mouse & keys, traditional windows folks are annoyed and can't yet see the point to metro. I'm sure in fact if you started to make the 2 children talk to each other and play nice then lots of people would start to see all the good things you have done in Win8 and not be distracted by the very very obvious things that we can all see are just not right yet in this OS.

    Thanks – Mike G

    NOTE: I has made an earlier not-signed in post … but it never appeared that I could see …

  62. If you don't like Windows then what are you doing here? says:

    I was regulary writing negative comments about iPhone at zdnet so they kicked me out.

  63. @MikeGCompass – I think you make some good points however I doubt there will be much energy from Microsoft around them. here is my thinking:

    Linking Metro contracts and Desktop would probably be very difficult to do – I am not a programmer so I don't speak with authority but I suspect the contracts assume a locked down environment and have minimal validation builtin which would make connecting it to the wide-open desktop programming environment a risky situation. They could probably make a new API set that links the two environments but from Microsofts viewpoint, why should they? They want to drive new innovation/apps to Metro, why would they spend programming effort to help increase the longevity of the desktop environment.

  64. pmbAustin says:

    Some very good points.  I wonder (I haven't tried it)… what if you "copy" something in desktop, and want to paste it into a Metro app?  Does that work well?  I would hope so.  What about the reverse?  Is it possible to select text in a metro app and hit Ctrl-C to copy it, and then paste it into a Desktop app?  I would hope so.  Is there a "touch" version of copy/paste?  Like on touch-phones?

  65. Customer says:

    Metro loves on Desktop !!! +INFINITE !!!

    Problem, Metro-haters ?

  66. Customer says:

    GAME OVER !!! Metro-haters (or Anti-Metro) !!! >:D

  67. Windows 8 - is a revolution of Windows 1.0 says:

    Windows 8 – is a revolution of Windows 1.0

  68. pmbAustin says:

    MS just needs to make sure that THIS isn't people's first experience with Windows 8:

    http://www.infoworld.com/…/ie10-windows-8-even-microsoft-cant-make-it-work-195293

  69. Game over will be said by people who are actually going to get Windows 8 or Not. Sale number will put Metro into coffin or we will see that crap in Windows 9 as well. Metro is fine for phones and tablets but doesn't belong to Desktop/Laptops/Servers.

  70. @Mark522010

    And that will be end of MS as we know and i could care less. Welcome Linux.

  71. DarkUltra says:

    A file manager, windowed applications and drag-n-drop FTW! :-)

  72. Truther says:

    Stop support Microsoft ! They support CISPA (previous SOPA but worse) !

    .

    http://youtu.be/OpIP71dDufw

  73. farmington says:

    @MikeGCompass

    I totally agree with your point about the Windows 8 UI. I too am using Win8 for about 80% of my work now days and am OK with the split-brain UI for the most part. However, the main annoyance is that my running desktop apps don't show up in the left hand bar and my running metro apps don't show up in the task bar. Switching between metro apps and desktop apps is confusing because there is no one place where I can see everything I have open.

    Also, I'd like to be able to put a desktop app on the left half of the screen and a metro app on the right half. If there is a way to do that, somebody please tell me. I'm OK if that means the desktop app is no longer resizable and no longer has window bar on top. No problem, Just let the two types of apps coexist and my life will be a LOT easier.

  74. farmington says:

    @StevieBallz, @JHawk111

    Thanks for your responses. I will have to dig into the File and Share contracts to see what they can do. I'm sad that Win8 won't support custom contracts but I agree that the power of contracts is that they are generic enough so that many apps can interface with them. I just wish there were some sort of "Processing" contract where my app could send arbitrary (or perhaps strictly formatted) data to another app for processing and get data back in return. There are so many possibilities this opens up. Our apps would no longer be isolated silos but ingredients in a recipe that the user creates. Here are a few I thought of:

    Image Processing:   My original example. Apps like Photoshop, Flikr and could help the user get a cool look for an image before returning to the calling app.

    Sound Processing:   Same thing as Image processing. The ability to create live sound filters would be great. I can see Creative creating some great SoundBlaster audio processing apps.

    Video Processing:  Same as above but with video. Imagine what the Adobe AfterEffects app could do for your app's video content.

    Text (Word) Processing:  Many apps let you author some text. Imagine if you could drop into the Microsoft Word app via a Text Processing contract where your user could get spelling, grammar and formatting assistance. Then, when returning to the calling app the user can take that text and post it to her blog (or whatever the calling app does with text.) (In fact, this would have been helpful in authoring this post.)

    Remote Control (Automation):  Our PCs now connect to our TVs, DVD Players, Cable box's, XBox's, toys, Arduinos, home automation, etc. It would be great if media playing apps and services could expose generic controls so that other apps could control them.

    Those are just a few ideas. The possibilities are endless. The more we can make our apps work together in ways that the original developer never imagined the more powerful and personal our computers become.

  75. farmington says:

    @pmbAustin

    I totally agree. That was the MAIN usability issue I ran into with IE10. No Silverlight and an endless update loop that makes it appear like you can get Silverlight if you just click one more link. They just need to bake it in, even if just for Microsoft's own sites.

  76. Martin says:

    Metro sucks on Desktop! +1

    Everybody who agree …  post the same comment.

  77. Martin says:

    Please add a start button in desktop to SEARCH like "WINDOWS BUTTON + Q". Oh man, metro in desktop really sucks, its very difficult to find things and uncomfortable to open metro apps with desktop apps. I prefer desktop apps because i can manipulate it easier than with metro.

  78. Siby A says:

    Is MS going to embed Silverlight also with IE 10 Metro just as they did with Flash Player? Otherwise it will be annoying as noted in this article

    http://www.infoworld.com/…/ie10-windows-8-even-microsoft-cant-make-it-work-195293

  79. Steve Monkey Ballmer says:

    Metro sucks on Desktop! +1

    Everybody who agree …  post the same comment.

  80. JGodo says:

    @Mark522010 Because Metro is not a solution for a lot of people, and for many is even a problem.

  81. @zammbi

    Visual Studio supports JavaScript, Visual Basic, C#, and C++ for authoring Metro style apps.

  82. @pmbAustin

    Copy and Paste will work between Desktop and Metro style apps.  JavaScript and XAML text entry controls and controls with selectable text will automatically support copy/paste scenarios.  This includes using both Ctrl+C and touch.  Apps can leverage the clipboard WinRT APIs for more advanced copy/paste scenarios.  A quick start guide on the clipboard APIs is located here:  msdn.microsoft.com/…/Hh750308 and the sample can be found here: code.msdn.microsoft.com/…/Clipboard-App-sample-309ec122.

  83. @Ocram Sotam

    At a high level contracts require all inter-app communication to go through a system broker (Windows). This helps increase end-user confidence because the user remains in control of which apps are communicating to each other.  It also helps increase developer confidence because the input being passed to their app happens in a well-defined way.

  84. @Scripticus

    Thanks for the feedback on other ways apps could work together to provide a great experience via contracts.

  85. Since I could not post in the “Building a rich and extensible media platform” post with it being locked, I placed my off-topic comment here.

    All of the “improvements” to media in Windows, there was not one mention about Windows Media Player. Nothing at all about usability fixes and upgrades. Still can’t scrub video in WMP or in the Metro Video app. Why?

    The seek line in both WMP and the Metro Video app is pretty much useless.  When using the seek bar, there is very little feedback to indicate where you are “jumping” to.  Why is there no option to show frame numbers instead of time?  Why not provide the option to show both?  This is not ability to pause a video and then use the keyboard arrow keys to move a single frame forward or backward.  QuickTime can; always could.

  86. @ pmbAustin: I’m with you as I have the same issue.  The baked in Flash is “broke.”  Here, again MSFT is trying to take a page from the Chrome playbook.  All because Google does it, does not mean MSFT has to.  I would really rather have Flash a separate add-on so that the end user can manage as necessary.

    @ Waqar Amjad: I could not have said it any better myself.  Don’t forget about Desktop gadgets.  They were supposed to be the next, best method of keeping users informed of whatever information they wanted.  My guess is that the gadget platform will be completely discontinued in Windows 9 and later.

    Nice.  I had the same exact experience with Metro IE.  http://www.infoworld.com/…/ie10-windows-8-even-microsoft-cant-make-it-work-195293

  87. Daitro says:

    Metro sucks on Desktop! +1