Tim Gabrhel

Variable Grid in WP8.1 Runtime Apps – Redux

I previously wrote variable grid’s in WinRT apps, and this is an addendum to that post. This update follows the same concepts, but with a few minor, yet effective, adjustments with respect to performance.

Updating the model

Open up the IVariableGridViewItem. We’ll start by renaming the Width and Height properties, and add a new Size property named SpanSize.

public interface IVariableGridViewItem
    int ActualWidth { get; }

    int ActualHeight { get; }

    Size SpanSize { get; set; }

Head over to the Item class that inherits the interface. We’ll start by adding a few static properties to be referenced later. This is where we define the different sizes that can be used by the grid.

Continue reading

Azure Search powered WinRT Apps Part 1

Azure Search is a new preview offering from Microsoft Azure to power your applications with features of search. The general idea is that you push your data into Azure search, let it manage the indexes that you define, and use it’s REST API to access the data. Traditionally, Search services are interval based and might only index your data every minute, hour, day, etc.

To start, we’ll be using this Azure solution that takes an ASP.NET MVC application as a starting point. The goal is to adapt this ASP.NET solution and prepare it for re-using Search API code across our web application and Windows Runtime apps. In the next post, we’ll look more in to adding features into a WinRT app to use the Search API.

Continue reading

Variable Grid in WP8.1 Runtime Apps

This post is a continuation of my original Uniform grid layouts post. Please see it for more information and the starting point source code for this post.

Upgrading the model

We’ll start by upgrading our existing Item model and MainViewModel‘s. In the Models folder, create a new interface named IVariableGridViewItem and define two int properties, Width, and Height.

Continue reading

Upgrading your Windows Phone SQL CE Apps Part 2

This is Part 2 in a series on Upgrading Windows Phone SQL CE apps. You can find Part 1 here.

Part 1 of this series ended where we have a Web Api that accepts a SQL CE Database file, and a unit test project to demonstrate submitting and the json data returned from the service. This post will demonstrate how to process the received data from the Web API in a Universal app.

Please note that all code provided below uses the applications LocalFolder for data storage, and does not exercise potential data syncing across Windows Phone and Windows apps via the RoamingFolder.

Universal App

Start out by creating a new Universal app.

Continue reading

Upgrading your Windows Phone SQL CE Apps

Back in WP7/WP8, they supported SQL CE 3.5 with the use of LinqToSql on top. A very powerful tool. Universal/WinRT apps are here, and we know they’re going to get significantly better with Windows 10. With Universal apps, the life of SQL CE (Compact Edition) databases are near the end, that is, if you’d like to continue making updates & using the latest developer tools. Now is the time to upgrade from these platforms, before it’s too late.

If you’re upgrading an existing SQL CE app to a Universal app, you have two choices: 1) retain user data or 2) wipe it away and start over. Obviously we’d like to retain the users data so they can have a smooth transition to the updated data store.

ASP.NET 4.0/4.5

As of ASP.NET 4.0, you’ve been able to target SQL CE databases in your ASP.NET web applications. With the power of Azure and Web Api, that’s exactly what we’re going to do.


Let’s start by creating a new ASP.NET MVC 4 Web Application with .NET Framework of 4.5.3. An alternative scenario is adding this project into your existing Windows Phone solution.

Continue reading

Auto Aligning Popups on WinRT Apps

Popup‘s in WinRT apps are really powerful to pop up content to prompt a user for some form of input. They are generally pretty straight forward to work with. They could be full screen, pinned to a corner, or you could open them relative to a button (or other element) the user interacts with. What happens when that button is near the edge of the screen, and the pop up opens off screen? Shortly, I’ll introduce the AutoAlignedPopup, but first, let’s start with the basics.


A Popup is a very basic element. It’s essentialy a container object that has properties for user interaction, and contains a child UIElement.

Continue reading

Flyout on Windows Phone 8.1 Runtime

Windows Runtime Flyout on Windows Phone is extremely versatile.The flyout control is a simple control you can attach to any FrameworkElement, or define as a resource and open it programatically.


A flyout has five placement modes, Top, Bottom, Left, Right, and Full. However, when working on the phone, only Top (default) and Full will work. This means, either you get a full screen, or pinned to the top. Definitely not ideal when trying to create a menu related to an app bar button. This comes straight from MSDN.

On Windows Phone, a Flyout is shown at the top of the screen by default. You can change the Placement property to FlyoutPlacementMode.Full to make the flyout cover the full screen. The Top, Bottom, Left, and Right values don’t have any effect in Windows Phone apps.

There are numerous ways to interact with a flyout, be it declarative, programmatic, or both.

Continue reading

Uniform grid layouts in WP8.1 Runtime Apps

With the advent of multiple device resolutions on Windows Phone, the challenge to provide a consistent experience across devices and resolutions increases. One of these specific challenges is providing a consistent grid layout, a concept very familiar to Windows Phone. As seen in the screenshot below, it’s not straight forward to fully utilize the full dimensions of the screen, while providing a nicely spaced grid.

Lead image credit goes to MVP Martin Suchan on Twitter

Continue reading

Windows Phone 8.1 WinRT Context Menus

If you search for Windows Phone 8.1 Context Menu, you’ll likely be riddled with Silverlight solutions, just as I did. Luckily, since Windows Phone 8.1 WinRT shares many components of Windows 8, using a context menu on your list data is quite simple, provided you know how to search for it. I was lucky to stumble upon the Menu Flyout so I’m here to share my finding.

WinRT MenuFlyout

MSDN has a great example on Menu Flyouts. A menu flyout in Windows 8 is a simple popup menu relative to the control the user is interacting with. On Windows Phone 8.1, this MenuFlyout control will be displayed as a full width popup, mimicking the context menu known to Windows Phone. Head over to MSDN to see the example.

Hope this helps.

Copyright © 2015 Tim Gabrhel

Theme by Anders NorenUp ↑