Should I use the Model-View-ViewModel (MVVM) pattern in Silverlight projects?

I definitely think you should use the MVVM pattern for Silverlight applications – and one of the benefits of the pattern is that you can actually make your application really blendable through some simple techniques. I often refer to “blendability” as “design for designability” – that you use certain techniques to make sure your application … Read more

Why dependency properties?

This helped me understand the reasoning: The main difference is, that the value of a normal .NET property is read directly from a private member in your class, whereas the value of a DependencyProperty is resolved dynamically when calling the GetValue() method that is inherited from DependencyObject. When you set a value of a dependency … Read more

Benefits of MVVM over MVC

Its a very slim distinction, which I can explain best by comparing MVC in ASP.NET and MVVM in WPF. In ASP.NET MVC the request comes in from the web server and is handled directly by the Controller. The Controller determines the appropriate View and populates it with Models. The Controller then releases these instances to … Read more

Setting a custom property within a WPF/Silverlight page

You can work with normal property without Dependency property if you create a Base class for your Page. public class BaseWindow : Window { public string MyProperty { get; set; } } <local:BaseWindow x:Class=”BaseWindowSample.Window1″ x:Name=”winImp” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” xmlns:local=”clr-namespace:BaseWindowSample” MyProperty=”myproperty value” Title=”Window1″ Height=”300″ Width=”300″> </local:BaseWindow> And it works even though MyProperty is not a Dependency or … Read more