
Contrôles et binding
Get flash to fully experience Pearltrees
Custom popup and windows in WPF the MVVM way
In WPF, using the regular window control to launch child windows makes MVVM and separating a View concern from the ViewModel very difficult. The problem: The window control works nicely as a shell for your application, however, launching child windows is problematic because the window control cannot be defined in xaml unless as the root element. So, if you wanted to launch child windows inside a parent window, you lose the ability to declare these in xaml. This loss means you will not be able to bind to properties in your ViewModel from the view for the purpose of opening/closing a window. Instead you end up doing this imperatively in code which means more code, more thought, more work. Following is what you end up doing in the most minimalistic cases.Why must WPF so cruefully complicated....
making the slider slide with one click anywhere on the slider?
Code Block public Window1() InitializeComponent();Being recently frustrated with the absence of an acceptable rating control for WPF , I ported the rating control from the Silverlight toolkit to WPF. A link to the full source code is provided below. To use the code you will need Microsoft Visual Studio 2010 and .NET 4.0 (currently available as a free downloadable “release candidate”).

