Redefine where NuGet packages get installed

31 July, 2013.

If, like me, you are working on multiple projects that reference the same packages (StructureMap is a great example) you may have noticed that each project has its own version of each package. In this bite sized post, we will look at how to redefine where your packages get installed.Root source control folderHere was my root source control folder before making any changes.When I dive into each folder, I see a packages folder, which contains each of my packages. Generally I use the same packages…

Continue reading

Consuming a WCF service without adding a Service Reference

29 July, 2013.

A problem I have had with WCF since I first discovered it a few years ago is related to Service References. The fact that I have to rely on the ServiceModel Metadata Utility Tool (Svcutil.exe) to generate a proxy class on my behalf left a sour taste in my mouth. A good solution would be for me to be able to write code myself to take this pain away.A Simple ApproachOne approach to do this is to take over the responsibility of creating bindings and endpoints yourself in your consuming application…

Continue reading

WPF MVVM IoC containers - Part 1 of 2

26 July, 2013.

The ultimate goal of MVVM is to achieve true separation of concerns, meaning that the various elements of your project know nothing about each other. It’s virtually impossible to achieve this in an elegant way in WPF without some outside help. For example, how to you tie the view model to a view? Here are some ideas that spring to mind; 1) You could set the data context directly in the view;You could set the data context in the views code behind file;Or you could set the data context when the…

Continue reading

Making NuGet work for your company

19 July, 2013.

NuGet is a package manager tool for the .NET Framework. NuGet is free, open source, and is supported by Microsoft Visual Studio, as well as several other environments. NuGet allows you to add packages to your projects, either from the public package gallery or from your own private package gallery. The latter is, in my opinion at least, somewhat under-utilised and misunderstood in the business world. This post aims to try to shed some light on how NuGet can work for your company.Public GalleryIf…

Continue reading

Entity Framework Code First In 15 Minutes

12 July, 2013.

Entity Framework is an Object Relational Mapper (ORM), created by Microsoft and built on top of the popular ADO.NET framework. Entity framework was first released in the second half of 2008. In 2011, with the release of version 4.1, a new feature was introduced… known as “Code First”. Code first allows us to write code without having to care (to a certain extent) about the make-up of the database, its tables and their relationships. The idea is that Entity Framework figures all this out for us…

Continue reading

WPF MVVM For WinForms Devs - Part 5/5

06 July, 2013.

The purpose of this series of tutorials is to introduce the Model-View-ViewModel (MVVM) design pattern, and look at how to quickly and simply implement it in a Windows Presentation Foundation (WPF) application. This series is targeted at developers of all levels, but especially at developers who are looking to make the transition from Windows Forms to WPF. This final part of the series assumes you have at least read the previous parts, or have a good working knowledge of WPF and the MVVM design…

Continue reading

WPF MVVM For WinForms Devs - Part 4/5

29 June, 2013.

The purpose of this series of tutorials is to introduce the Model-View-ViewModel (MVVM) design pattern, and look at how to correctly implement it in an Windows Presentation Foundation (WPF) application. This series is targeted at developers of all levels, but especially at developers who are looking to make the transition from Windows Forms to WPF.Events in Windows Forms applicationsAssuming you have come from a Windows Forms background, regardless of what design patterns (if any?) you used…

Continue reading

WPF MVVM For WinForms Devs - Part 3/5

22 June, 2013.

The purpose of this series of tutorials is to introduce the Model-View-ViewModel (MVVM) design pattern, and look at how to correctly implement it in a Windows Presentation Foundation (WPF) application. This series is targeted at developers of all levels, but especially at developers who are looking to make the transition from Windows Forms to WPF.Capturing user inputIn the previous walkthrough we; set up our view model, bound it to the view, and added a property for our model class. We then…

Continue reading

WPF MVVM For WinForms Devs - Part 2/5

15 June, 2013.

The purpose of this series of tutorials is to introduce the WPF MVVM (Model-View-ViewModel) design pattern, and look at how to correctly implement it in an Windows Presentation Foundation (WPF) application. This series is targeted at developers of all levels, but especially at developers who are looking to make the transition from Windows Forms to WPF.How to quickly implement MVVM in your C# WPF applicationStart by firing up an instance of your favourite version of Visual Studio (free or paid…

Continue reading