Command Service calls Delegate

Aug 28, 2009 at 7:53 PM
Edited Aug 28, 2009 at 7:54 PM

Hello,

how can I use the CommandService to call a Delegate? If I click the Button, nothing happens, but in WPF it works fine.

Thank you,

Manullino

 

Here is my code:

XAML Code:

xmlns:command="clr-namespace:SLExtensions.Input;assembly=SLExtensions">

....

<Button x:Name="LoginButton" Content="Login" command:CommandService.Command="{Binding GoToLogin}"/>

 

C# ViewModel Code:

public class LoginViewModel : ILoginViewModel
{
public ILoginView View {get; private set;}
public DelegateCommand<object> GoToLogin { get; set; }

private IUnityContainer _container;
private IRegionManager _regionManager;

public LoginViewModel(ILoginView view, IRegionManager regionManager, IUnityContainer container)
{
View = view;
View.Model = this;

_regionManager = regionManager;
_container = container;

//GoToLogin = new DelegateCommand<object>(OnGoToLogin);
GoToLogin = new DelegateCommand<object>(OnGoToLogin);
}

private void OnGoToLogin(object parameter)
{
_regionManager.Regions[ShellRegionNames.MainRegion].Remove(this.View);
ApplicationRoot.bootstrapper.RegisterAllRegionsAndViews();
}


}