Metro Nuggets

Bitesized tidbits for building Modern (Metro) apps.

Personalisation, Cimbalino and Universal Windows Apps

With Windows 10, two key areas of personalisation for a user are the lock screen and the wallpaper images, and this is both on phone and desktop. And on both you’ve always been able to set the lock screen image (for now we’ll just forget that WPA8.1 apps couldn’t!), but setting the wallpaper was something you couldn’t do in either desktop or phone. Now that’s changing with Windows 10. Whilst the APIs for settings these aren’t the most complicated ones in the world (Wallpaper/Lock screen), no-one would ever say they wouldn’t like things even simpler, right? Also, how about being able to set these things from a viewmodel in a PCL?

Read more of this post

Cimbalino, Debugging, and NotSupportedExceptions

Cimbalino is a great toolkit that supports most of Microsoft’s current platforms (including the new UWP), it has a useful set of services and interfaces that really help make building modern apps on Microsoft platforms a doddle. The way in which it does that is by use of the “bait and switch” approach with its PCL and various platform specific implementations. What this does mean, however, is there may be occasions where a service method may not be supported for a specific platform, at this point, Cimbalino will throw a NotSupportedException. The problem with doing this is you may have your logic in a PCL and using Dependency Injection using Cimbalino’s services; your viewmodels may not need to know, or care, about whether a platform supports a particular call, but having that call may crash your app. So what then?

Read more of this post

My UWP Nuget Package is Missing a File?

When creating a nuget package that’s intended for a UWP, you’d be excused for creating your package in the same way you always have done, you include the new uap10.0 TFM (Target Framework Moniker) and drop your dll file(s) in there. This is 95% of it, but there’s a sneaky extra 5% that you still need to do, otherwise, whilst your package will still be valid, and will still get pulled into a UWP project, that project won’t be able to build.

Read more of this post

Introducing Bex, A PCL Library for the MS Health APIs

Yesterday Microsoft [finally] released the MS Health APIs they’d talked about at this year’s Build conference. These APIs are a way of accessing the data that’s been accrued from your Microsoft Band, so any bike rides, runs, sleep tracking, etc. These APIs are a set of REST endpoints that, once authenticated, you can call to access this data. So, naturally, I’ve decided to make this easier.

Read more of this post

Introducing InteractiveToastExtensions for Universal Windows Apps

One of the new ways users can interact with your app is through notifications. Now, notifications are nothing new, for either Phone or Desktop, however, what’s been added to 10 is new. With Universal Windows Apps, you can now have interactive toast notifications. So what are these? They are like regular toast notifications only they can have elements that the user can interact with, maybe make a selection, or type in a response to something.

There’s an excellent blog post on MSDN that covers all the different types of interactions you can have within your app’s toasts, along with all the xml elements that are required in order to build your toast notification, but that does mean dealing with xml, and who likes that?!

Read more of this post

Adding photos to the Windows 10 Phone Emulators

When you’re writing an app that requires the user to choose a picture, you give them the photo picker, which allows them to choose a photo from their device. Great. But what about you, as the developer? What about when you’re using the emulator? The old Windows Phone 7 emulators came with some built in images that you could pick (we’ve all seen them in the store screenshots, admit it!!), then with the Windows Phone 8 emulators, you had to perform a little dance to get them. But what about the Windows Phone 8.1 and Windows 10 emulators? And wouldn’t it be nice if you could more easily use real word pictures, rather than stock photos?

Read more of this post

Windows Universal Apps, Cimbalino and the App Back Button

One of the things you can add to a Desktop variant of a Universal Windows App is a back button that a developer can add to their app; this back button appears in the top left corner of the app. In order to use the back button, the developer needs to tell it to appear, as well as potentially wire up to the back button’s pressed event, but that’s not the Cimbalino way.

Read more of this post

Using Unplated “Tile” Images In UWP Apps

I realise the first question you have: “Unplated?” Well, give me a chance. In your app’s package manifest, you have a section for Square44x44Logo, this logo is used in the task bar and in the application list in the start menu. What you will notice is that, by default, your image will have a border around it, like so:
image

Notice the grey all around the icon (note: that grey is defined in the package manifest too, so doesn’t have to be that colour)? Now, for your app’s branding, maybe you don’t want that border as that goes against how your actual tile looks, and consistency is key, right!

Read more of this post

Use Triggers To Change Grid Column/Row Values in Universal Windows Apps

When creating your awesome layout to your awesome new app, you’ll often use Grids as a way of ensuring things are placed where you want them to be and you’d most likely use the ColumnDefinitions and RowDefinitions. Using these has a number of benefits, not least letting you specify exact heights/widths for your columns/rows, but you can also use Auto and the * values to set screen percentages. What this means is you can have a very exact UI or one that adapts as the size of the window changes.

Adapting to the size of the window is something that’s more relevant to UWPs than ever before with you bringing one UI to all possible screens the user can use your app on. But what if you still want to keep some rows at a certain screen percentage until the user hits a trigger point? Well, a small, but subtle change to xaml now allows you to do more with your Column/RowDefinitions.

Read more of this post

Introducing MDL2 Helpers

Another new thing that’s being introduced in Windows 10 is something that’s being seen as the next evolution of Metro: MDL2 (Microsoft Design Language 2). This brings about a whole new set of iconography for Windows 10, some of which can be seen in the settings app (on both phone and desktop).

If you want to read more about MDL2, whilst not technical, this would be a good place to start.

The icons that are available can be used by using the Font Segoe MDL2 then using the relevant code to get the icon. But where do you get those codes from? Well, Austin Andrews (@templarian) has put together a great online resource that lists the icons and their representations. But this can be a pain to copy and paste, look up what a code is, etc. So is there an easier way?

Read more of this post

Follow

Get every new post delivered to your Inbox.