Blog: 2015 January

Recommendations and best practices for implementing MVVM and XAML/.NET applications

January 30, 2015, (updated on June 15, 2018), 37 comments, Software Development

In this article I’ll describe the rules and practices I’m following for XAML and MVVM application development. I’m using the described techniques since multiple years and they have proven themselves for me. Most of the described rules apply for all types of XAML projects – Windows Store, Windows Phone, Silverlight and WPF projects. Sample code: The source code of the application Visual JSON Editor contains sample implementations for most of the discussed recommendations. Some sample code snippets in this article use the MVVM classes from the MyToolkit library which is developed by myself. Project file structure All MVVM/XAML applications should […] Read more...

Tags: , , , , , , ,

How to mimic singlecast events in C#

January 12, 2015, (updated on February 13, 2015), Software Development

C# only supports multicast events and delegates. Even if you define a delegate property without the event keyword, it still remains multicasted: public class Foo { public Action MyEvent { get; set; } } var foo = new Foo(); foo.MyEvent += delegate { }; foo.MyEvent += delegate { }; The only difference between a regular property with a delegate type and an event property are: The event property can only be invoked by its class, the delegate in the regular property can also be invoked from outside (which may not be desired) Accessing and assigning an event property is only […] Read more...

Tags: , , ,

  Page 1 of 1