Contrôles et binding
Get flash to fully experience Pearltrees
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.
Introduction This is actually a pretty simple article, and to be honest, I ummed and ahhed about even making this an article at all. I thought it might make a 1/2 decent blog post, but in the end, I thought that it would benefit more people as a published article, so I decided to publish this dead simple article as an article and not a blog post; sorry for its shortness. I know it's not my normal style article, but hope that is OK; I just felt it was useful is all. So what does the attached code actually do?
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”).
Introduction Earlier today, I was working on a new form for my Silverlight application, and I realized that I needed to bind an enum to a group of RadioButton s. Being a highly skilled, advanced software engineer, I rolled up my sleeves, put on my thinking hat, and.... attempted to Google the solution. I knew what the basic solution should look like in that I was sure a creative converter solution would be involved, but I was looking to save some time and effort. What I found online however, was very disappointing.