Building apps? This is the stuff about that
13 Sep 2012

Windows Store apps

Looking for development advice & help with Windows Store apps? Check out my development snacks series!

Prefer videos to reading? Check out my videos on Youtube!

Amazing Lock Screen

Bing has the greatest images & now you can get use them for your lock screen!
Amazing Lock Screen allows you to select from the eight most recent Bing images and quickly select which of them to set your lock screen to use.
In addition BAmazing Lock Screen allows you to automatically have your lock screen updated daily with the latest image from Bing - thus ensuring a constant supply of inspiring and interesting new content for you!

MORE INFO

Download

English to Afrikaans to English

30 000 words and phrases that enable you to translate between English and Afrikaans! Perfect for those living in South Africa or those wanting to travel to South Africa!

MORE INFO

Download

Image Grabber

This is really a simple app, find images on a website and pull them down to your machine so you can browse them, save them or share them. There is some special logic for some websites – such as Tumblr blogs where it will pull down using the API rather than raw scraping of the pages.

MORE INFO

Download

Lab Rat

Lab Rat takes Valve's amazing Portal 2: Lab Rat comic and puts it in your hand and on your tablet in amazing HD! Not only can you read it in English but included is the Russian language and also all images without text! Perfect for wallpapers and lockscreens!

MORE INFO

Download

Notepad Classic

A simple text editor for Windows 8!

MORE INFO

Download

Pin-a-note

A great sticky note application for Windows!!

MORE INFO

Download

South African Postal Codes

All the postal codes for South Africa so you can search, pin & browse them in an easy to use application!

MORE INFO

Download

08 Sep 2012

The new .NET 4.5 feature every XAML developer will love

If you develop using XAML and you are using .NET 4.5 (i.e. WPF or Windows 8) then there is a feature that will make you smile a bit, CallerMemberName. XAML developers often implement INotifyPropertyChanged to enable updating of data bound fields. If are smart, you often wrap the raising of the event into a simple method you can call, for example:

public void RaisePropertyChange(string propertyName)
{
    if (PropertyChanged != null)
    {
        PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
}

This leads to code that looks like this:

private int ticks;

public int Ticks
{
    get { return ticks; }
    set
    {
        if (ticks != value)
        {
            ticks = value;                    
            RaisePropertyChange("Ticks");
        }
    }
}

There are some problems with this

  1. Refactoring – rename the Ticks property and even if you use the VS refactoring tool it won’t find the string in the method call.
  2. Magic strings – It is just a string so there is nothing to make sure that you spelt Ticks in the string the same as Ticks in the property name.
  3. Copy & Paste – If you copy & paste another property, you must remember to rename this string too.

The solution: CallerMemberName

.NET 4.5 includes a new parameter attribute called System.Runtime.CompilerServices.CallerMemberName which will automatically place the name of the calling member (i.e. method or property) into the parameter. This enables us to change the method signature to:

public void RaisePropertyChange([CallerMemberName] string propertyName = "")

Note: The attribute in front of the property & note we have also given it a default value – when using this attribute your parameter must have a default value.

Now we can change the calling definition to

private int ticks;

public int Ticks
{
    get { return ticks; }
    set
    {
        if (ticks != value)
        {
            ticks = value;
            RaisePropertyChange();
        }
    }
}

Now we have solved all the problems with the string in the method call! Go and enjoy!

Below is a file with a sample application to get you started (everything is in MainPage.xaml.cs).

AttachmentSize
Package icon demo.zip21.69 KB
03 Jul 2012

Where do I start to learn Windows 8?

I have been asked at the talks I do, where can I go to learn Windows 8? What material is available? There is a LOT of content available for Windows 8. For me personally I learnt initially from the Windows 8 Camp in a box and building my own test apps. However the ever amazing Bruce Nicholson provided me with a fantastic list recently (so go thank him):

25 May 2012

Windows 8 Boot Camp: Johannesburg 24 May

imageYesterday Rudi Grobler & I had awesome fun with a full room of amazing people who took time off work to attend a full day of free Windows 8 training. The audience was amazing, breaking a lot of my expectations of how audiences react at free events, which really honoured Rudi & I to have most people stay to the very end of the day.

5b

For those people who attended the training, or those who didn’t but want the content too:

AttachmentSize
Package icon Windows 8 Demos551.64 KB
07 May 2012

JSinSA 2012

jsinsa

AsHoIrXCEAA2s1YThis past weekend was the ever fantastic JavaScript in South Africa (JSinSA) conference. This year focus was on HTML 5, JavaScript & CSS 3 – easily some of the MOST important topics for developers regardless of platform to know about.

It was it’s second year and while I was very lucky to go to it as an attendee in the first year, this year I was even more lucky to be a presenter at the conference. I was also very lucky to present on a topic I am passionate about: Windows 8.

The talk provided an introduction to Windows 8 & how development works, and in the 45mins I was done, we built an application which could take a photo from a web cam and send it to Twitter (the actual photo is to the right).

You can get the slides and bits from the talk below.

AttachmentSize
File Demo Script18.56 KB
Package icon Completed Demo660.07 KB
11 Apr 2012

Windows 8 for the .NET developer

Last night I presented on Windows 8 for the .NET developer at the fantastic Developer User Group! We had a bumper crowd there which was great and really had some interesting discussions during and after the talk. Thank you to all that attended!

For those looking for the slides, demo script and demo bits they are below!

AttachmentSize
Package icon Completed Demo Files54.29 KB
File Demo script16.71 KB
20 Mar 2012

Windows 8 Bootcamp

windows8logo_large_verge_medium_landscapeLast week (14th March 2012, to be exact) I had a great opportunity to travel to Cape Town and present the first ever Windows 8 Bootcamp there! (I missed the first in South Africa by two days, that was presented in Jo’burg by Rudi Grobler).

It was a small event, but it was a great day of learning and sharing and what a lovely place it was to present, as you can see from the photos below!

One of the requests from those who attended the event was the demos & slides – however there is a snag, Microsoft owns the slides and they are not ready for them to be publically shared Sad smile  That said the demo bits are below, so hopefully that will keep you sorted until the slides arrive.

WP_000655WP_000656

AttachmentSize
Package icon Windows 8 Cape Town Camp.zip597.72 KB
01 Mar 2012

How different is Metro Style (WinRT) development really? The beta post

goodworkNote: Before you read this post, it is using the public consumer preview (beta) of Windows 8, VS 11 & .NET 4.5, so I expect some issues will likely be resolved in later releases. Check the site out for more info!

With the beta of Win8, VS 11 & .NET 4.5 now out I thought I should post again (first post about this can be found here – recommended reading to see how it has improved) how it has improved or changed since the alpha. This is not meant to be an exhaustive list, it is a list of the most common things (where most common is what I use, because I am pretty common Smile with tongue out)

Namespaces

Namespaces have been polished and there is a much better alignment of the new awesomeness to the old so this is getting much better.

#if NETFX_CORE
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml;
    using Windows.UI.Core;
    using Windows.UI.Xaml.Controls.Primitives;
#else
    using System.Windows.Controls;    
    using System.Windows.Controls.Primitives;
#endif

Duplication of INotifyPropertyChanged, ICommand & INotifyCollectionChanged is SOLVED!

I mentioned about the EPIC FAIL of the duplication of core interfaces – that has been solved! SmileSmileSmile

ObservableCollection<T> is broken is SOLVED!

The double facepalm that was breaking ObservableCollection<T> has also been solved – so this means your Metro style apps are more like your WPF & Silverlight apps than ever before.

User Controls must be created on the main thread is SOLVED!

I did not get a stupid behaviour where a user control had to be created on the main thread, and thankfully that has been solved! You can now create user controls on other threads! SmileSmile

IValueConverter has been changed

Previously the Convert & ConvertBack methods second parameter was a string, now it has been changed to a Type. This is a good move as it allows for better compares, but means any IValueConverters from alpha will be broken and it is a simple change:

//Before broken
public object Convert(object value, string typeName, object parameter, string language)

//After changing type of second parameter = working
public object Convert(object value, Type typeName, object parameter, string language)

Good work image from http://bloggers.com/posts/happy-developer-37379

Pages