WPF Application developers would be experiencing or would have observed that after updating MVVMLight Toolkit package to Version 5.0.0 or 5.0.1, RelayCommand - CanExecute() mechanism is not working anymore. This issue is been already reported by MVVMLight user on codeplex as Issue# 7659. As explained by Laurent: WPF is the only XAML framework that uses the CommandManager to automagically raise the CanExecuteChanged event on ICommands. Unfortunately, there is no CommandManager in PCL (portable class library). CanExecute() is an input parameter of type action, it can be a method that returns bool based on which binding updates to allow or block command execution. This is to be passed when instantiating RelayCommand property that will bind with your control's Command property and fire the default event based on user action. A hot fix is released for above mentioned issue as Version 5.0.2 and now available on » Read more

 Jsinh        

Drag and drop and one of the UI interaction every user loves to have. I gave it a whip in something I was playing with at home. There might be better ways to bring Drag N' Drop interaction in WPF application but I choose to use GongSolution for WPF Drag Drop One reason for using this library for drag and drop interaction is that the library supports MVVM way to do it and does not require much integration to get started. You can add Gong WPF DragDrop library from Nuget into your MVVM enabled WPF application. Add enable a UI element for drag - drop support add following properties to it: DragDrop.IsDropTarget="True" and DragDrop.DropHandler="{Binding}" Here is how my sample XAML file looks like after adding above mentioned properties. <Window x:Class="GongDragAndDropSample.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http: » Read more

 Jsinh        

Sharing small stuffs I figure out while working with WPF !! Originally when you select any item in a ListBox control in WPF, you will observe that the background color of item turns LightBlue (if not using some kind of theming mechanism). Also when the ListBox control is not in focus or active i.e. some other control is in focus, the background color of selected item in ListBox will turn light grey (very light indeed). It would look something like this: Code snippet to apply in style / resource of the ListBox control to change the background color of the selected item when in focus or active and not in focus or inactive: <ListBox> <ListBox.Resources> <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush} » Read more

 Jsinh