Click here to Skip to main content
15,896,207 members
Articles / Desktop Programming / WPF

TIP: Handling WPF DialogResult with simplicity

Rate me:
Please Sign up or sign in to vote.
3.89/5 (8 votes)
4 Sep 2010CPOL 37.4K   1  
Shorter way to evaluate DialogResult after calling Window.ShowDialog

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
18 Jun 2010Andrew Rissing
Or even...if (frm.ShowDialog() == true){ // do something here}
Please Sign up or sign in to vote.
26 Jul 2010catbirch
if(frm.DialogR...
Please Sign up or sign in to vote.
28 Jun 2010Thornik
May be this is better?if (f.ShowDialog() ?? false) { // ebat' melkosoft za takie prikoly}
Please Sign up or sign in to vote.
7 Sep 2010Member 2722225
what about this one :if (new frm().ShowDialog().Equals(true)) { //do something }

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Peru Peru


Computer Electronics professional, Software Architect and senior Windows C++ and C# developer with experience in many other programming languages, platforms and application areas including communications, simulation systems, PACS/DICOM (radiology), GIS, 3D graphics and HTML5-based web applications.
Currently intensively working with Visual Studio and TFS.

Comments and Discussions