evanwon / WPFCustomMessageBox

A WPF clone of the native Windows/.NET MessageBox with extra features like custom button text.
122 stars 63 forks source link

Add default MessageBoxResult to the window #9

Closed DoruLa closed 1 year ago

DoruLa commented 10 years ago

You can add a default MessageBoxResult in the DisplayButtons method. That way, if the user clicks on the close button of the window, the result returned will not be None in case of Yes/No/Cancel message boxes.

kcl93 commented 1 year ago

Hi @DoruLa This is actually the intended behavior and a reason why MessageBoxResult.None is a valid result. Changing this would change the expected behavior compared to the original MessageBox. I would suggest to handle the None case in your code together with whatever value your default behavior should be.