Archive

Archive for January, 2011

WPF MVVM Presentation – V2

January 30, 2011 1 comment

A couple of months ago, I posted some slides on MVVM. This was to be the basis of a session I was doing on introducing a few colleagues to the MVVM pattern. As it turned out, the presentation had a little too much content that should have been left out. For example it introduced concepts such as Dependency Injection, Dialog Services and others that muddied the waters a bit.

The aim of the session was to introduce the MVVM pattern from a WPF perspective. As a result, I have put together some resources, post presentation, that do not deal with extra details, but rather look at the MVVM pattern as it is implemented in a very basic form, in order to put across the concepts.

Warning: Some of these presentations are a bit raw! 🙂

1. A walkthrough of a simple WPF Application.

This presentation outlines a simple WPF application for managing simple notes, containing a title and content. The application allows users to add, delete and edit notes, as well as view them. The intention of this presentation is to demonstrate a quick and dirty WPF solution, highlight briefly its issues and use it as a basis for developing a MVVM based solution. The application is not exactly spectacular looking and if you know how to write WPF applications using code behind, this presentation may be worth skipping. The video is about 30mins long.

2. My original adopting MVVM presentation

This is the original post that contains an overview of the MVVM pattern before going on to introduce an example that contains implementation detail that detracts from presenting MVVM. It is still worth viewing as it does outline MVVM as a pattern. The video is about 20 mins long.

3. An MVVM Version of the WPF Application

This is the application walkthrough that shows how to construct the application presented in the first part of this post, but using the MVVM pattern. It highlights the key concepts of MVVM and how these can be implemented simply using WPF. The presentation does not demonstrate concepts such as DI and does not use extra libraries, such as Prism, that my first application demo did.

4. The Source Code

Finally, I have added the source code for this application, which may be of interest if you want to play around with the code and look at it in a bit more detail. Be aware that this is a very rough and ready application, intended as a demonstation.

Categories: MVVM, Training, WPF Tags: , , ,

An Introduction to WPF

January 25, 2011 Leave a comment

I’ve recently been putting together another MVVM intro presentation. Whilst doing so, I have put together some screen capture videos of developing a WPF with code behind and using the MVVM pattern. This post contains the video recorded for that presentation. It’s a bit raw and there are some references to other parts of the presentation, but I still thought it would be worth posting here for those interested in a quick introduction to a WPF/XAML application. The video is about 30mins long and contains me rambling on a bit. Sorry, I’ll get better at these with practice 🙂



WPF Presentation

Categories: Training, WPF Tags: , , ,

Microsoft WebMatrix released.

January 25, 2011 1 comment

Microsoft recently released WebMatrix as a tool for developing web apps, with particular emphasis on deploying solutions based on open source web applications such as wordpress. As I have been thinking about moving this blog to my own server, I thought I’d give it a go… this may well be my last blog before moving to a new domain!

On startup of WebMatrix, I am presented with a simple quick start screen:

As I want to build a WordPress site, I select ‘Site from Web Gallery’. This is where I have the option of installing a whole range of web applications (40 at present) as the following screenshot suggests:

So I call my site name sputnikdev, select WordPress and click ‘Next’. It then asks some questions about installing MySQL if you want to run against a local copy. I chose to use MySQL on my web host. It then goes through the process of downloading and installing the required files. It then asks for some MySQL connection details, before confirming that everything is installed correctly and presenting you with the application screen:

Clicking on the URL then successfully brought up the WordPress start page for setting up an initial user and the database.

I then clicked on “Set up the remote publishing location for your website” link at the bottom of the screen, to set up my ftp connection, which allows you to test the connection…. always a handy feature those who are developing a user configurable server connection in their app.

Once this was done, I was already to publish my site.

I clicked on Publish. WebMatrix tests that the connection has certain compatibility. This all came back with errors, but then this was to be expected over FTP on my web host, so I selected continue anyway. WebMatrix then gives you a preview of changes (in this case all files). There was a warning about overwriting local databases, which was irrelevant in my case, so I hit continue and crossed my fingers.

And then off it went, copying the files in the background, which was a nice touch.

Once it was done, a quick look at my site (ignore the URL for the moment, it will be published here once the site is ready) revealed I probably needed to add PHP to my hosting package and wait for that to be ready, perhaps I should have paid closer attention to those compatibility errors.

And here it is, wordpress installed with very few steps using WebMatrix:

In conclusion, WebMatrix was incredibly simple to use for setting up a standard site, obviously the advantage with open source web apps is that they can be customised and extended. WebMatrix assists in simplifying the process of doing this and then testing and deploying. Now all I have to do is get my new sputnikdev blog set up, the data exported from my wordpress.com site and get that imported. Maybe I’ll also add a gallery for my collection of paintings.

Update:

Because I chose to run against a remote database when testing, the deployment was not setting site URLs correctly. This site URL is stored in the database. More details on how to fix it, if you come across this problem, can be found here: http://drewby.com/2010/09/using-web-deploy-to-sync-your-webmatrix-site/

Categories: Web Tags: ,