Drag and drop photos into Windows 10 Universal apps

The new Windows 10 platform brings drag-and-drop functionality to Windows Universal apps for scenarios such as dragging a document or a photo from a folder straight into app. It allows us developers to support more intuitive experiences. Find out how simple it is to drag and drop a photo from desktop into your Windows 10 Universal apps in the rest of the article. Note that that everything here is written using Windows 10 Technical Preview build 10074 and Technical Preview Tools, so things can change. Let's start by creating a new, blank Windows Universal app. This creates one blank page,…

Read More

Using SQLite in Windows 10 Universal apps

Using SQLite in Windows 10 Universal apps (UWP) is really easy even in this preview phase. Even though Entity Framework 7 support for Windows 10 Universal apps is almost here, you still might decide to just continue using a lighter SQLite.Net-PCL library that you're used to since Windows Phone 8/WinRT. Note that that everything here is written using Windows 10 Technical Preview build 10074 and Technical Preview Tools version 10.0.10069.0, so things can change. Also, SQLite extension is in pre-release, so things can break, stop working or change. EDIT: Post has been updated with the…

Read More

3 dangers of Windows RelativePanel

We got a great new layout panel in Windows 10 apps called RelativePanel. It's really easy to use, although as XAML developers, we're used to thinking about layout based on Grids and StackPanels and similar panels. RelativePanel requires a slightly different way of thinking about layout, but it simplifies adaptability and can really help in reducing XAML both to describe layout and to define different VisualStates. However, there are some dangers and scenarios to keep in mind when defining the layout using RelativePanel and it will take some time for developers to get used to it. Note that that everything…

Read More

WinDays 15: Universal UI in Windows 10 Universal apps

This week I gave a presentation at the most important Microsoft event in Croatia (and possibly this region) about Windows 10 development, more accurately about news related to creating universal, adaptive UI in Windows 10 apps. This included 3 new concepts based on what we've seen in the first developer tools preview - SplitView, RelativePanel and state triggers. The presentation went really well in my opinion. The audience seemed quite interested in Windows 10, there were around 80 people at the session, which is a bit more than I usually got for Windows Phone development sessions. Note that that everything…

Read More

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

SQLite logic error or missing database - now what?

I've spent a few hours today trying to figure out why SQLite (and SQLite.Net-PCL) wasn't working in a Windows Phone 8 app, but the same code and same library worked in WPF app. If you're facing this exception when working with SQLite.Net-PCL, I hope this post will help you resolve it quicker. First of all, let's face it - even though we would all love to work on new Windows 10 Universal apps ever since the latest Developer Preview tools came out, most of us are still actually working on supporting and developing Windows Phone 8+ apps that…

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

MenuFlyout flip animation on Windows Phone WinRT

MenuFlyouts are a standard part of Windows Phone apps. If you go to system apps such as Calendar and try to switch view by clicking the button in the Command/AppBar, you'll notice that the MenuFlyout shows and sort of flips. However, if you try to show a MenuFlyout in your app, you'll see that it has a different entrance animation. The system animation looks like this: Imagine you wanted to show a MenuFlyout when CommandBar button was clicked. CommandBar is simply defined in Page.BottomAppBar. <Page.BottomAppBar> <CommandBar x:Name="AppBar"> <AppBarButton x:Name=…

Read More

Cancel page navigation in MVVM Light and WinRT

There are often situations in which you may want to cancel navigation. Imagine a form being filled in, and all of a sudden user accidentaly presses back button and ... whooops ... all entered data is gone. In that particular situation you might want to ask the user if he wanted to do that and if he wanted to preserve the data already entered. This article shows how to do it "MVVM-way" using MVVM Light. When it comes to properly handling navigating to and from a page using MVVM Light, I really like the approach suggested by Marco Minerva in his blog…

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

Sinergija 14 sessions

This was my third year in a row as a speaker at Sinergija, Microsoft conference taking place in Belgrade. Here are a few words about my sessions and of course links to my presentations. The conference is clearly getting better every year. The venue and accommodation was wisely and well chosen, there's a bunch of young people running around making sure that everything runs smoothly, the attendees and organization member were pleasant. I'm happy for the opportunity to give two sessions alongside some great, experienced speakers and great experts. If you want to learn more about the agenda, visit the…

Read More

Larger ProgressBar rectangles on Windows Phone

Normally you'd want to use a standard size of rectangles in an indeterminate ProgressBar. However, in case that you need larger rectangles, there's an easy way to accomplish that! A standard way of adding a ProgressBar is just to define it in XAML and say that it's indeterminate by setting the IsIndeterminate property. In MVVM architecture you'd probably bind Visibility property to a property in your ViewModel (probably a boolean, then convert it with a converter to appropriate Visibility value) to show and hide it depending on some ongoing action. <ProgressBar IsIndeterminate="True" /> Nothing new really. It results…

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