How I can bind one of my buttons on control to X Button that closes the window ? I just want to create cancel button that just closes the window. I am using MVVM in my code.
You can just call the Close() method, which will close the window.
Close()
private void MyButton_Click(object s, RoutedEventArgs e) { Close(); }