Simple WPF Login demo, with MVVM pattern

There is a newer version here.

I was offering myself to prepare a quick WPF Login demo (having a minimum set of best practices) for a colegue, so here it is. (I’ll update it with more details and, perhaps, new versions):

  Simple WPF Login Example (16.3 KiB, 2,675 hits)

It uses the MVVM pattern, no code behind (except the lines in which the DataContext is set), binded commands, IDataErrorInfo for business entities, INotifyPropertyChanged.

The goal was to provide a testable WPF application, by using the .NET Framework already builtin capabilities (like it or not) and taking advantage of data binding. Some tricks (like showing error at Tooltip) are very common practices.

I used the password as a simple TextBox just to show binding.  Normally, a PasswordBox should be used, with attached property for binding (next version).

Also for next version I’ll separate the business code into a separate project (now is in a simple folder, just for demo) , perhaps add a quick authentication service, a test project and more.

For more advanced scenarios you should consider using of Prism (Composite WPF from Microsoft Patterns and Practices).

Comments are welcome!

emipasat posted at 2009-9-23 Category: Development/Programming | Tags:

One Response Leave a comment

    Leave a Reply

    (Ctrl + Enter)