TAG: Windows Phone

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…

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…

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…

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…

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…

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…

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.…

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…

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…

Demo SensorCore SDK from your Windows Phone using SignalR with Azure Websites

Last weekend I gave a session at KulenDayz about SensorCore SDK. While trying to prepare a good demo, I realized I had 3 possibilities - fake data by shaking my phone (not a good demo), prerecord data and use a simulator (boring demo) or display data in real time as I walk and run around the room. The choice was obvious - wear my running shoes and do a real-time demo! The first step was to…

Launch motion settings without SensorCore SDK

I've been playing with SensorCore SDK lately, and a part of the SDK is the possibility to launch the system motion settings on the device straight from the app to allow the user the change settings related to motion data collection. Here's a tip on how to launch it without the SensorCore SDK! As you probably already know, a way to launch different settings or other apps from your app is to call LaunchUriAsync method like…

#wpdev - which open source projects do you use?

I am preparing a session about open source in Windows Phone development and I'd like to hear from the awesome #wpdev community! I am a real fan of open source in #wpdev and I admire people who invest their free time, energy and knowledge to make things easier for others. So, if you use open source in your apps, which ones are your favorite? Are there any that you add immediately after creating a new project?…

LayoutTransform in Windows Phone 8

I wrote about LayoutTransform back when I needed it for Windows 8 XAML development. I modified the existing Silverlight Toolkit code to work with Windows 8 and it was great. Now a lot of people are asking the same question over and over again on StackOverflow - where's LayoutTransform in Windows Phone Toolkit? Here's an example of that questions: http://stackoverflow.com/questions/20663740/layouttransform-not-in-windows-phone-toolkit And I've seen another 2-3 in the last 2-3 weeks. Well,…

Augmented reality with GART - what's changed on Windows Phone 8

I wrote an article a year and a half ago about using GART with Windows Phone to create augmented reality scenarios in really easy steps. It's linked in the GART project documentation and it gets a lot of attention and even questions from people working on Windows Phone 8 apps. The article was written with Windows Phone 7 in mind, but conidering it's still being used as reference getting started implementation, I decided to write about…

Add Google Analytics to your Windows Phone and Windows Store apps in 3 easy steps

Even though there's often little love in the clash of Google and Microsoft titans, which we recently witnessed in the whole 'YouTube API and Windows Phone app' saga, there is a large number of users who use what they think is the best of both worlds. When it comes to websites analytics, the most popular solution today is Google Analytics. How can you use it in your Windows Phone and Windows Store apps to gain insight…

Microsoft Certified Solutions Developer: Windows Store Apps in C#