This project has moved. For the latest updates, please go here.

RelayCommand strange problem

Sep 7, 2014 at 7:44 AM
Hello there,
i'm using the MVVM Light Toolkit for an home made project.

At this stage of the application development i'm trying to add some functionality to some button (mostly change page, show a flyout panel or similar)

the strange is that i define 2 different RelayCommand inside my Constructor, but only one of them works...
so.. the commands:
            OpenSettingsPageCommand = new RelayCommand(() => CurrentPage = settingsPageViewModel);
            OpenMenuCommand = new RelayCommand(() => _menuViewModel.IsMenuOpen = true);
To ensure that my view knows about the command value assigned i also do:
            RaisePropertyChanged(() => OpenSettingsPageCommand);
            RaisePropertyChanged(() => OpenMenuCommand);

CurrentPage is the ContentControl inside my window that represents my pages:
        private AbstractViewModelBase _currentPage;
        public AbstractViewModelBase CurrentPage
            get { return _currentPage; }
                if (_currentPage == value)

                _currentPage = value;
                RaisePropertyChanged(() => CurrentPage);
And is Binded in Datatemplate like this:
<ContentControl Name="CurrentPageContentControl" />
The strange fact is that if i try to Bind OpenSettingsPageCommand where i bind OpenMenuCommand it still doesn't work (so its not a Binding problem imho)
Otherwise, Binding OpenMenuCommand where OpenSettingsCommand is Binded works without problem.

Please feel free to ask me any question if i was not clear,
thank you in advance for any answer,