What’s on my Windows Phone – my favourite apps

I’m often get asked what apps I have installed on my phone. After explaining I have a Windows Phone 8 (Lumia 720) the question usually results in an awkward “erm..okay, nevermind”. But sometimes a fellow Microsoft enthousiast can be found. It is for these people that I have compiled a list of the apps I have on my ‘start menu’ (e.g. use-a-lot-apps) and those installed (e.g. handy-apps) So without further ado: Read more of this post

A clickable Windows Phone slider

The default behavior of the Windows Phone Slides control doens’t allow a user to click on the slider where the value should be set to. Instead, tapping anywhere on the slider will simply result in the slider incrementing by it’s default or given incrementsetting.

Following small piece of code shows how to have the wanted behavior by responding to the Tap- event of the Slider (named mySlider in the following codepiece).

        private void UIElement_OnTap(object sender, GestureEventArgs e)
           if (mySlider.Orientation == System.Windows.Controls.Orientation.Horizontal)
                var pos = e.GetPosition(mySlider).X;
                var width = mySlider.ActualWidth;
                mySlider.Value = (pos/width)*mySlider.Maximum;
                var pos = e.GetPosition(mySlider).Y;
                var height = mySlider.ActualHeight;
                mySlider.Value =(1- (pos / height) )* mySlider.Maximum;

A WP7 databound graph control

For a project we are working on, we needed a simple (and free) WP7 graph usercontrol. The data which the usercontrol visualizes needs to be databound and each time new data arrives, the graph should update itself on-the-fly .In the following tutorial we’ll show how to create such a control from scratch (make note that normally this should also work in Silverlight or WPF projects).

A demo-solution of this tutorial can be downloaded here.

Read more of this post

Creating an Intellisense compatible enum-based Dependency Property

Actually, this post has a way too fancy title , because in fact I will merely show that enum-based dependency properties are IntelliSense compatible “out-of-the-box”. (by the way, if you know all about dependcy properties: simply read the line in bold and you’ll know all there is to know).

When creating a (WP7/SL/WPF) usercontrol, one often ends up creating one more dependency properties (DP). Most of the times you only want a discrete set of possible values that can be assigned to the DP. The logical choice then of course is to have an enum-based DP.

Now, for the Intellisense to work it is important that you define the enum type OUTSIDE the usercontrols class. For example, suppose we have define the following enum:

public enum GraphTypes {Default, Point, Line}

Now, all that remains is to add a DP that uses this enum (remember that you can use the ‘dependencyproperty’ snippet that comes with VS):

        public static readonly DependencyProperty GraphTypeProperty =
            DependencyProperty.Register("GraphType", typeof (GraphTypes), typeof (GraphControl), new PropertyMetadata(GraphTypes.Default));

        public GraphTypes GraphType
            get { return (GraphTypes) GetValue(GraphTypeProperty); }
            set { SetValue(GraphTypeProperty, value); }

Once you now add the usercontrol elsewhere in your xaml-code, IntelliSense will happily show what values can be assigned to the DP:

There we go. That’s all there was too it.

Next post I’ll show how to create a WP7 user control to plot graphs using data binding. Consider some of the code here a sneak preview.

Writing a WP7 website scraper application

In this tutorial I will explain how you write a WP7 application using the HtmlAgility Pack in order to use information scraped from a website.
Website scraping is the act of retrieving information from a website page. An act by some considered stealing, by others borrowing. Let’s leave that debate to the others. In this post I will show how easy it is to scrape content from a website so that you can (re)use it in your Windows Phone 7 application. As it is, this information will for the most part also work in other, non WP7, projects of course.
Sometimes website scraping is the only means available to consume certain information from a website. If the website doesn’t have some publicly available API or web service you can use you’re pretty much left with scraping, whether you like it or not.

Read more of this post

7 WP7 dev tools you might not know but will want to have

There’s an incredible amount of guides, tools and utilities to be found on the Internet (or should I say ‘tha cloud’?) for Windows Phone 7 developers. Compiled in this article are some of the tools I’ve come across on my searches which I now use frequently but didn’t know the existence of beforehand. Read on to change you WP7 development life. Read more of this post

Learning to cook with WP 7.5 data (a book review)

Recently I received a review copy of the “Windows Phone 7.5 Data Cookbook” by Ramesh Thalli from Packt Publishing (ISBN 978-1-84969-122-2). This book, divided in 8 chapters, shows how simple it is to write data-driven programs WP7 applications.

What follows is an extensive review of this book.
Read more of this post