Metro Snack #2: What is WinRT?

What is WinRT?

It doesn’t seem like a great idea to go into a series of posts talking about Metro-style apps without briefly defining the core components that they are built on.  The most fundamental piece of the puzzle for these apps is Windows Runtime, or WinRT for short.  WinRT is probably best described as an unmanaged, native API that can be leveraged from many different languages via a mechanism called language projection.  Read more to find out some more details about how WinRT works.

Continue reading

Metro Snack #1: Choosing XAML or HTML5 for Windows Developer Preview apps

XAML or HTML5?Windows 8 Metro Style app development starts with choosing a user interface technology path. Developers will need to choose whether they will create their user interface using XAML or HTML5. Choosing XAML means that the business logic for the application can be implemented using C++, C#, or VB. HTML5 apps will mainly use JavaScript for this purpose (note: it is possible to call into C++/C#/VB code in an HTML5 app).

Which should you choose?

Continue reading

Metro WebView Source and HTML workarounds

WebView Workarounds

In the process of writing my first Windows 8 Metro style app using C# and XAML, I came across some limitations of the current WebView control’s implementation.  The flow for the feature I was working on is fairly simple:

  1. Content for a webpage is displayed in a WebView (using the WebView’s Source property).
  2. User browses the page until they find something they want to save.
  3. User clicks a save button and the app parses the information into a readable format for saving in the app’s storage.

This is a pretty straightforward concept and I thought the implementation would be just as intuitive. Judging by the similarity of the WebView control to the Silverlight WebBrowser control, I went about implementing this functionality as I would have for Silverlight.  I set the WebView’s Source property to the initial Uri where I wanted the browsing to begin.  I wired up a test button that I thought would kick off the parsing process.  That’s when I started to run into problems.

Continue reading