I have a mainwindow, and another window called Loginwindow. In some point this LoginWindow will shows up to get some login info... In the LoginWindow I have a button and it's Command property is binding to OkCommand in the MainViewModel like this:
<Button Content = "Ok" Command="{Binding OkCommand}"/>
In my MainVeiwModel I added a OkCommand RelayCommand
public RelayCommand OkCommand
{
get { return new RelayCommand(OkClose); }
}
private void OkClose()
{
MessageBox.Show("Close Login");
}
this code executes well and the MessageBox has appeared when I click the Ok button.. but how do I close the LoginWindow when I click the Ok button...