When would ShowDialog() return null?
Posted
by Joe White
on Stack Overflow
See other posts from Stack Overflow
or by Joe White
Published on 2009-06-13T06:16:39Z
Indexed on
2010/03/18
4:41 UTC
Read the original article
Hit count: 503
WPF's Window.ShowDialog method returns a nullable boolean. So does CommonDialog.ShowDialog.
Now, I understand cases where these would return false (user clicked Cancel or pressed Esc), and when they would return true (code sets Window.DialogResult to true, probably in response to OK being clicked). But null?
My first thought is that clicking the title bar's Close button might return null. But the docs state (and I confirmed by testing) that the title-bar Close button is treated as a Cancel.
So when would Window.ShowDialog or CommonDialog.ShowDialog ever return null?
© Stack Overflow or respective owner