private void CreateAlbumView_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { CreateButton.AutomationPeerInvoke(); } else if (e.Key == Key.Escape) { CancelButton.AutomationPeerInvoke(); } }