> ## Content Index
> Fetch the complete content index at: https://blog.jsinh.in/llms.txt
> Use this file to discover other available public pages before exploring further.

# Relay Command CanExecute() not working using MVVMLight Toolkit in WPF
- URL: https://blog.jsinh.in/relay-command-canexecute-not-working-using-mvvmlight-toolkit-in-wpf/
- Published: 2014-10-21T14:52:00.000Z
- Updated: 2026-07-07T15:10:05.000Z
- Author: Jsinh
- Tags: #Import 2026-10-04 19:16

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](https://mvvmlight.codeplex.com/workitem/7659?ref=blog.jsinh.in).

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 NuGet for update](https://www.nuget.org/packages/MvvmLightLibs/5.0.2?ref=blog.jsinh.in).

**Imp**: The fix is not applied by default. As originally and even now the `RelayCommand` is available in `GalaSoft.MvvmLight.Command` namespace of `GalaSoft.MvvmLight` library. This is the new implementation for `RelayCommand` (the PCL version).

`RelayCommand` for WPF that supports `CanExecute()` invoke automagically is now shifted to `GalaSoft.MvvmLight.CommandWpf` namespace of `GalaSoft.MvvmLight.Platform` library.

**What does this mean?**

To apply the `CanExecute()` not working issue - hotfix, you need to change the namespace `GalaSoft.MvvmLight.Command` to `GalaSoft.MvvmLight.CommandWpf`.

**Note:** This fix only applies to WPF - MVVM light toolkit consumer applications as specified by Laurent.

Full change-log can be found at this [location](http://www.galasoft.ch/mvvm/installing/changes?ref=blog.jsinh.in).

Thank you Laurent for the fix, Happy Coding !!