Life tiles into your Modern (Metro) Application (WinRT)


Hello,

 

Today I have an idea for an application using all “modern” (formerly Metro). As part of this idea I needed a Life tile. I look quickly into the SDK but not found a reference of how any hub tile control built-in in WinRT SDK. Thus my second idea was to import one already done in Windows Phone Toolkit. This last approach worked smoothly. In my example I’m using code decompiled by dotTrace, but since Windows Phone Toolkit is open source you can go to codeplex side and download it.

As usual you can get the source code from my github account at: https://github.com/hmadrigal/playground-dotnet/tree/master/MsWinRT.HubTileSample

The problem

I want to include hub tiles (life tiles) into my Modern (Metro/WinRT) application.

The solution

Import the HubTile control from the Windows Phone toolkit at http://silverlight.codeplex.com/releases/view/60291 and import this control to WinRT.

In reality I decompiled the code instead of importing it, but it would have been easier to download it. In any case my example is using decompile code, and it’s based on the Grid Template. There is not much work behind it, only decompile, copy, paste and compile. There were few changes, but they’re not worth to mention. That said, here is the control, and I hope you can have some fun with it.

https://github.com/hmadrigal/playground-dotnet/tree/master/MsWinRT.HubTileSample

Advertisements

2 comments

  1. hi, i was trying to reproduce the hubtile component without success in my own App. I copy-pasted the HubTile, HubTileService, ImageState ,MultipleToSingleLineStringConverter and VisibilityConverter in a folder named “Controls” in my win8 App.
    I added the namespace without problems and the HubTile object at the xaml level. after all, i bind some values to Title…and i am able to see its values in blend at the “properties tab” (no bind problems)…but when i execute the App, the hubtiles are totally empty 😦
    i tryed to add static text for example to “Title” and a static image, but same results 😦

    any idea? i think i miss something
    thanks

    1. Hi @Enrique

      May I know which version of Windows 8 are you using and also which version of visual studio? I’m asking this because of when I wrote the sample the version of Windows 8 was Release Preview and for Visual Studio was Release Candidate. This might produce some differences, moreover have you been able to compile and run the sample application?

      Regards,
      Herber

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s