Bitesized tidbits for building Modern (Metro) apps.
There are a number of blog posts, that show off a new feature in Windows 10 development call xaml views, that allow you to have a different xaml file for the same page depending on the device family (a great one here by Morten). There may be genuine reasons where going for an adaptive approach might not be right for your app depending on the design constraints of your app, in which case it makes perfect sense that you’d want device specific views.
Coming soon with the new Lumia devices is a nice feature called Continuum, which allows you to effectively use your phone as a PC, where you can connect it to a monitor, and use a mouse and keyboard with it, and really shows to highlight the universal aspect of Universal Apps as you effectively then have a desktop UI that you can use. So using a desktop on a mobile, what could go wrong?
Turns out, your UI could go wrong. Why? Because although you’re seeing a desktop UI, the OS is still reporting to your app that it’s a mobile device, which means it will use any mobile specific views/code that you may be using. This means that although you have this gorgeous desktop UI, when a user uses your app in Continuum, all they will see is the [still gorgeous, I’m sure] mobile UI, but not the desktop one. So how do you get around this?
The funny answer is you actually have to go back to adaptive triggers, but not based on height/width, instead on device family.
My recommended steps are as follows:
What about Xbox One/IoT?
Since neither of these have any interaction with Continuum, you can continue to have device specific views for both of those without any negative impact.
I’ll concede this solution isn’t the most elegant, and it would be better if the device family could be reported as Desktop when being run in Continuum, because the platform *must* know, right? But as it stands, you just can’t rely on it right now.