The basic idea behind a Cancel button is to enable closing your window with an Escape Keypress.
You can set the IsCancel property on the Cancel butt
Yes this is right.In windows Application in WPF AcceptButton and Cancel Button is there. But one thing is that if you are setting your control visibility as false, then it won't work as expected.For that you need to make as visibility as true in WPF. For example: (it is not working for Cancel button because here visibility is false)
So, you need make it:
Then you have write btnClose_Click
in code behind file:
private void btnClose_Click (object sender, RoutedEventArgs e)
{ this.Close(); }