Project Description
Caliburn.Micro and Bound controls library for Windows Forms and Visual WebGUI.

Updated 2015-08-05

Caliburn.Micro for Windows Forms and Visual WebGUI

Project statement

The MVVM FX project targets Windows Forms and Visual Web GUI.

The project focus shifted from a collection of loose tools to a development framework based on three libraries:
  • Caliburn.Micro MVVM framework
  • bound controls library
  • general purpose data binding library
The project's main goal is the MVVM framework. Caliburn.Micro is one of the best MVVM frameworks around (some would say it is the best). Based on a partial port from Dan Durland, the missing features were added, bit by bit.

In order to do proper MVVM, one must use controls that support data binding. Some of the standard Windows Forms controls (or Visual WebGUI controls for that matter) don't comply with this requirement, namely TreeView. The bound controls library fills this gap.

Due to Windows Forms binding shortcomings, a general purpose binding library is instrumental for the Caliburn.Micro port. The MvvmFx.Windows library is based on Truss and includes some features that aren't needed for the Caliburn.Micro port. The same source code was used to build MvvmFx.DataBinding, a smaller version of the library, that is stripped off of all method binding parts, like Action or Command binding. Note Caliburn.Micro does not need an implementation of ICommand because it has Actions which are superior to commands in every way, as Rob Eisenberg puts it.

Project status overview

  • Updated to Caliburn.Micro 1.5.2+ (latest fixes before BCL port)
  • MvvmFx.CaliburnMicro CSLA.NET adapter
  • Targets .NET 4.0 / 4.5 / 4.5.1
  • Fully documented source code.
  • Stable development stage.
  • Four (4) samples are ready, one (1) is published but still in progress.
  • A NuGet release is bound to happen any day.

To-do list

  • NuGet release
  • MvvmFx.CaliburnMicro Dialog Extensions
  • Thorough test of BoundListView
  • Unit tests for binding library support for Validated event

Start using MVVM on your Windows Forms or Visual WebGUI projects now!

Supports complex binding paths for convention binding

  • Read Caliburn.Micro source control entry for this feature.
  • This feature enables the use of a Model property to maintain the data.
  • To bind the Model property "InvoideNr" to a UI TextBox, just use the UI TextBox name "model_InvoiceNr" (case insensitive).
  • Examples on the samples.

Full support for Caliburn.Micro parameters

  • $eventargs
  • $datacontext
  • $bindingcontext (feature for WinForms and WebGUI)
  • $source
  • $executioncontext
  • $view
  • $this
  • $this.property for parameter binding (exclusive feature of this port)
  • "object.property" for parameter binding
  • Auto refresh of guard method ".property" parameters (with a little help from MvvmFx own binding library)
  • Examples on the samples.

DataBinding library features

  • Bindings à la WPF, with Converters, one way, two way, etc.
  • Can bind to about anything using the binder systems below:
    • INotifyPropertyChanged
    • <property>Changed event (used by Windows Forms and Visual WebGUI)
    • control Validated event (used by Windows Forms and Visual WebGUI)
  • Stable development stage.

BoundControls library features

  • Can use BindingSource or BindingList.
  • Available controls:
    • BoundListView (beta)
    • BoundTreeView (stable)

Old news

  • MVVM FX release 2.0.2 went NuGet on 28-10-2012. Look for "mvvmfx".
  • New on release 2.0.2
    • MVVM Light Toolkit partial port for Windows Forms and Visual WebGUI using MVVM FX

Binding tools features

  • Data binding for any CLR object (this is a kind of a fork of Truss) (released under Ms-PL license)
  • Command binding to any input event on UI objects (released under Ms-PL license)
  • use WeakReference to avoid memory leaks
  • DependencyObject and DependencyProperty for any CLR object, namely Form and UserControl under Windows Forms and Visual WebGUI (this is a kind of a fork of GitHub mono / mono) (released under the MIT license).

Data Binding

  • Bindings à la WPF, with Converters, one way, two way, etc.
  • Can bind to about anything using one of the binder systems below:
    • INotifyPropertyChanged
    • <property>Changed event (used by Windows Forms and Visual WebGUI)
    • WPF DependencyProperty
    • MvvmFx own DependencyProperty

DependencyObject and DependencyProperty

The requsite of this module is to make it easier to port MVVM libraries (like MVVM Light or Caliburn.Micro) and use them under WindowsForms or Visual WebGUI. The implemention isn't complete as it stops where the referred goal is achieved.

Data binding timings

Test specification: set a single property 100.000 times

Debug mode

MvvmFx binding
==============

Bind to source INPC: 2.005 msec.
Bind to target TargetObject: 2.062 msec.

Bind to source XxxChanged: 2.005 msec.
Bind to target TargetObject: 2.023 msec.

Bind to source XxxChangedGenericArgs: 1.983 msec.
Bind to target TargetObject: 2.032 msec.

Bind to source SystemDependencyObject: 2.352 msec.
Bind to target TargetObject: 2.410 msec.

Bind to source MvvmFxDependencyObject: 3.207 msec.
Bind to target TargetObject: 3.275 msec.

WPF binding
===========
Symmetric
---------
Write to TestWpf: 6.570 msec.
Write to TestWpf: 6.159 msec.

Asymmetric
----------
Write to TestWpf: 6.517 msec.
Write to INPC: 8.710 msec.

Release mode

MvvmFx binding
==============

Bind to source INPC: 1.939 msec.
Bind to target TargetObject: 1.948 msec.

Bind to source XxxChanged: 1.866 msec.
Bind to target TargetObject: 1.923 msec.

Bind to source XxxChangedGenericArgs: 1.888 msec.
Bind to target TargetObject: 1.934 msec.

Bind to source SystemDependencyObject: 2.228 msec.
Bind to target TargetObject: 2.286 msec.

Bind to source MvvmFxDependencyObject: 2.897 msec.
Bind to target TargetObject: 2.950 msec.

WPF binding
===========
Symmetric
---------
Write to TestWpf: 6.530 msec.
Write to TestWpf: 6.137 msec.

Asymmetric
----------
Write to TestWpf: 6.508 msec.
Write to INPC: 8.622 msec.

Note
This project's scope used to be Model-View-ViewModel application framework and library for WPF, Surface, and Silverlight.

I'm much obliged to Sam Bourton for transferring project ownership and thus allow the use of the MVVMFX name.

To Join

To join this project and make your own contribution:
  1. Register on CodePlex
  2. Go to my Codeplex page and send a contact.

Last edited Aug 5 at 2:06 PM by tiago, version 147