Categories
.NET C# Entity Framework WPF

Understanding HB Code – Line of business application for WPF – Part I

 

HB Code – Line of business application for WPF

MVVM Architechture Overview

This project is made available as open-source and hosted freely on www.codeplex.com.

Prerequisites

  • Object-oriented programming using C#.NET and LINQ.
  • Nuget package usage.
  • Basic knowledge of WPF application building such as input controls, container controls, triggers, styles, templates.
  • Entity Framework, currently knowing any of versions of Entity Framework will work to check the working sample.
  • Sql Server 2005 database configuration and Sql queries.

Built

Technologies: .NET 4.0, WPF, Entity Framework 4.3 Code First,

Control toolkits: Avalon Dock, Avalon Dock MVVM, WPF Toolkit, WPF Extended toolkit, Microsoft Ribbon for WPF

Tools: Visual Studio Professional 2010, Sql Server 2005 Express, Entity Framework Power tools extension, Nuget Package Manager.

Please note: Current implementation is kept intentionally strongly typed to keep it easy to understand and reduce development time at initial stage.

Solution Projects Overview

  • HBCode Application (View)

This is the main entry point of the application. In this part, we have all the WPF and UI specific code implementations. It basically contains the WPF resources, WPF converters, Extended User Controls, Images, Application and Database Configurations, and Views (UserControls) used in the application.

  • HBCode Business Logic (Model)

This project contains all the business modules, business logic validation, and database connectivity, property change notifications implementations. Currently it uses Entity Framework 4.3 Code First with migrations to connect with the database. The Entity Framework 4.3 building blocks such as Database Context, Models, and Migration classes exist in this project.

  • HBCode Presentation (ViewModel)

This project contains the middle-tier ViewModel classes. View Model contains Collection of models, single models and sometimes aggregate properties for display purposes. The UserControls aka View are Databound to ViewModels containing model instances. ViewModels are built considering the UI layout and requirements. Such as if we consider a Sales billing UI will be containing Item list in grid and there will be one ComboBox column to display items to select from, so to Databound the Combobox we could either List<ItemModel> property in ViewModel at top-level or we can implement List<ItemModel> per row instance in List<ItemSaleModel> which would be bound to grid.

This project is made available as open-source and hosted freely on www.codeplex.com. You can download the source from www.hbcode.codeplex.com.