MenuFlyout subitems in Windows 10 Universal apps

A very useful new feature has been added to MenuFlyouts in Windows 10 Universal apps: from now on, we can add subitems/submenus, which allows us to group items and open/show them as requested. When mouse is available, the submenu opens on mouse-over event, and when only touch is available it opens on a tap. You can also use keyboard to navigate through items, and open the submenu item sections. It's really easy to use subitems. Just create a MenuFlyout and add a MenuFlyoutSubItem item wherever you need it. MenuFlyoutSubItem then takes more MenuFlyoutItem items. Note that that everything…

Read More

Getting started with SplitView control in Universal apps

SplitView is a new, interesting control available in Windows 10 Universal apps and it is actually nothing more than a navigation affordance, as it's called in the Developer's Guide to Windows 10 Preview. It's also a very customizable control which doesn't really force any kind of style on you by default, except for the bare minimum of how it behaves when opened (Pane DisplayMode set to Inline, Overlay, Compact Inline, Compact Overlay), there's a default animation etc. Here's how it looks in the Xbox Music app when the pane is collapsed: and here's the same app when pane is open:…

Read More

Composite primary keys in SQLite.Net

SQLite.Net-PCL is one of the best SQLite client/ORM out there in a PCL form supporting Windows Store and Universal apps. It's open source, but it's not feature complete, and you may learn the hard way that some things are missing. Being open source is a good thing, which means that you can add support for anything you can imagine or need yourself. One of the things missing (currently, in the master branch of the original repo) is support for composite primary keys. Composite primary keys (or compound, there's a subtle difference) basically mean that you can use two…

Read More

Output SQLite queries when using SQLite-net in Universal apps

When debugging code which works with databases, you'll often want to see the queries which are being executed to find possible bugs or simply understand how the database wrapper works. There's a simple way to do it if you use SQLite-net wrapper, but as it's not documented, you have to guess or read the source code to find it. Going through source code is usually not a big deal (open source ❤), but I hope this will make it easier for people who don't have the time to do it. There are currently two dominant libraries you can use to work…

Read More

Pass ListView SelectedItems to ViewModel in Universal apps

One of the things that WinRT devs need to work around in Universal apps is the fact that you can't bind straight to SelectedItems of a ListView/GridView. There are a few ways to pass SelectedItems to the ViewModel and here's one that can get the job done quickly. The method I'll use in this post uses EventTriggerBehavior to invoke a command in ViewModel when a SelectionChanged event occurs. For that to work, you need to add the Behaviors SDK to both of your projects (Windows and Windows Phone) in your Universal app. Whenever you want to use the classes…

Read More

MVVM Light session at Advanced Technology Days 10

I love talking about MVVM and encourage developers working with XAML platforms to at least explore it, learn more about it, and consider using it in whatever way works best for them and their team. I also love the simplicity of MVVM Light and how it's really easy to learn it and start using it quickly. I delivered a session at Microsoft Advanced Technology Days 10 event in Zagreb, Croatia, last week, and here's my presentation. The session includes some really basic info about MVVM as a pattern. Then I moved on to MVVM Light trying to cover as much…

Read More

Get device information on Windows Phone 8.1 WinRT

I see many interesting question on StackOverflow every day. One of those today was the question about determining if Windows Phone 8.1 app is running in the emulator. Here's one way you can get that information! Finding out information about the device is useful in many ways, but one reason you might want that is definitely to know the difference between running on emulator and on a real device. Typical way of doing this on Windows Phone 8.0 was to use Microsoft.Devices.Environment.DeviceType and this actually keeps on working on Windows Phone 8.1 Silverlight, so…

Read More

Alignment grid in Universal WinRT apps

Alignment. So important and yet often forgotten by so many developers, especially the ones who don't work with designers. Remember Grid? It's here to stay with Windows Phone 8.1 and also with Universal apps. And yet, if you create a Silverlight Windows Phone 8.1 project, you get the alignment grid out of the box, but not in Universal apps. What if there was a Universal solution? As I mentioned, you get the alignment grid in Silverlight Windows Phone apps in form of AlignmentGrid.png image file, but not when you create WinRT Windows Phone apps. Considering that the…

Read More

MVP Reconnect - say hi on Twitter

Microsoft MCSD

profile for igrali at Stack Overflow, Q&A for professional and enthusiast programmers

Latest Posts