Surface WinRT available in DK

23 Jan

Today Microsoft announced that Surface Windows 8 Pro will be available start on Feb. 9 through all Microsoft retail stores and from microsoftstore.com. This is really great news! I love my WinRT and I have high hopes for the pro edition.

At the same time it was announced that Surface WinRT will be available to 13 additional markets in the coming weeks – including Denmark! Finally! Looking forward to see through which stores it will be possible to buy them in Denmark.

The parameter is incorrect

17 Dec

For the last couple of months we have been working on some different Windows Phone projects. Yesterday we ran into an exception in one of our projects. Sometimes when we navigated into a specific page we got an argument exception “The parameter is incorrect”. The exception was inconsistent but we got it more often when debugging compared to when we ran our project in release mode.

2012-12-17_013042

First step was of course to enable as much debugging info as possible which resulted in this StackTrace:

at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value)
at System.Windows.PresentationFrameworkCollection`1.Add(UIElement value)
at System.Windows.Controls.ItemsControl.AddVisualChild(Int32 index, DependencyObject container, Boolean needPrepareContainer)
at System.Windows.Controls.ItemsControl.AddContainers()
at System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedObj)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at Microsoft.Phone.Controls.Pivot.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at Microsoft.Phone.Controls.PhoneApplicationFrame.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)

The page was actually pretty simple – a Pivot control with 4 items each containing a usercontrol. So with the StackTrace in mind we looked for some dynamically sized controls within our usercontrols . First of all we tried to change the Pivot control with a Panorama control – still got the exception. So we had to go through our code and line by line we removed content – still got the exception. In the end we had removed all the content inside our usercontrols and the page was stripped down to contain only the most necessary properties. Still got the exception.

In the end I stumbled upon the naming of our usercontrols – not in the page but the x:name within the usercontrol itself. Some of the usercontrols had been giving names that was used as part of some animation. What caught my eye was that two of the usercontrols got the same x:name. I tried to change one of the names and boom! Problem solved.

So to take this little issue to the test I created a small sample demonstrating the issue. The sample automatically navigates from one page to another and back until the exception is through (takes about 2-5 minutes).

The issue is on both Windows Phone SDK 7.1 and 8.0.

// thomas

Spotify – we will do your Windows Store app for free!

14 Dec

It’s a shame to see that Spotify still isn’t available for Windows Phone 8 and Windows 8. I understand that they probably have a big backlog and can’t have apps of this size available in just a few weeks.

However Windows 8 have been available for some months now and we haven’t heard anything from Spotify about a realistic release date. The result is obvious – users cancel their subscriptions and find another musicplayer. Just check out the forums and the comments in this thread – users have an excellent alternative in Xbox music.

A few weeks back my team and I decided to take a radical step – we offered Spotify to do the Windows 8 app – for free. We have developed our share of apps for the Windows Store; 20+ apps ranging from video-on-demand apps to homebanking apps.

We still haven’t heard anything from Spotify.


http://community.spotify.com/t5/Spotify-Ideas/Windows-8-Metro-App/idc-p/223348#M14834

Resource Dictionary for Windows Phone

6 Nov

One of the missing templates in the Windows Phone SDK is Resource Dictionaries. If you work with styles and resource dictionaries, the missing template is a big thing.

Worry no more! I have created the template you need!

You can get them ItemTemplate from my SkyDrive and install it in your ItemTemplate folder, typically located here:
C:\Users\[USERNAME]\Documents\Visual Studio 2012\Templates\ItemTemplates\Visual C#\Windows Phone\1033

// thomas

Installation Folder in Windows Phone 8

2 Nov

The installation folders for Windows Phone apps (also known as appdata) are read-only and reading data from files in the folders hasn’t always been the best experience. We have been able to use GetResourceStream to stream files from the appdata folder and DataContext to work with a local database.

With Windows Phone 8 we got some improvements. We got a new property of the current package called InstalledLocation. It returns the installation folder as a StorageFolder and using the Path property it’s possible to get the full path of the installation folder. Using the StorageFolder we are able to work with the files in the appdata folder.

The content of the appdata folder can easily be accessed using the appdata or ms-appx URI scheme names. Although the two schemes point to the same location, there is an important difference in the usage of the two. Use “ms-appx:///” for accessing the appdata folder with APIs that are part of the new Windows Phone Runtime (part of the Windows namespace). In all other APIs use “appdata:/”.

If we want to get a file asynchronisly we can use Windows.Storage.StorageFile.GetFileFromApplicationUriAsync
to access the file. As the API is part of the new Windows Phone Runtime, it is required we use “ms-appx:///” to access our file:

If we just want to specify an Uri we can use “appdata:/”:

// thomas

Templates in Visual Studio 2012

1 Nov

For some time now I have developed XAML based Windows Store apps using Visual Studio Ultimate 2012. The apps are built for clients as part of my company targeting consumers. What I’m trying to get to is that I use Visual Studio and the built-in templates quite a lot. And with that also comes some features requests :)

The built-in solution templates are fine. They are good for getting started and learning about the new guidelines for building Windows Store apps and Windows Phone apps. I guess that every Windows Store developer have tried to build a demo app based on the templates. So my issues comes to adding new items to my projects. Every time I add a new Page or new UserControl to a project, I have to delete 20 lines of comments in the XAML and in the code-behind (especially for Windows Phone 8). The comments describe how to get started using the items and how to read more about the type of item. This is great information for new developers or developers getting to know the platform – but it’s not appropriate in a pro tool like Visual Studio Ultimate. Why not have it in a starter kit or in the Express editions of Visual Studio (only).

To answer a comment that most likely will pop-up – yes I’m aware that it’s possible to customize the content of the items. It just shouldn’t be necessary in pro tools like Visual Studio. I think.

// thomas

Where is the Skype app for Windows Phone?

1 Nov

Yesterday I wrote a blog post asking about the missing Build app for Windows 8. Rumors says the app is built but failed certification hence not available for the attendees – it has not been confirmed by Microsoft!

Until today Nokia Lumia 800 have been my primary phone. Today I’m taking my new Nokia Lumia 920 (thank you Microsoft and Nokia!) and doing it the only true way – making it my primary phone. It’s a big phone but the technical features are awesome and combined with Windows Phone 8 I expect a great experience. I have customized it (making it my own) and I already love some of the new features – especially the “Rooms” feature – it’s really communication made easy!

For the last couple of months I have been addicted to Skype. With the new Skype app for Windows 8 my expectations for the running the app on a Windows Phone 8 device was pretty high. I have been running Skype on my Lumia 800 but it’s almost useless without a front faced camera. Open the store, searching for Skype and gets several results – but no Skype app?! Frustration kicking in! Searching the internet to get an answer.

Turns out that Skype have built a new app from the ground up for Windows Phone 8 supporting some of the new awesome features available in the Windows 8 app and using the new features available in Windows Phone 8. Skype have announced that it is soon-to-be available. Read the full story and get an overview of the new features at their blog or take a look at this video.

// thomas

Follow

Get every new post delivered to your Inbox.

Join 1,221 other followers