Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF & OpenFileDialog (Win32 vs Forms)

$
0
0

I'm a programming student and I'm presently enrolled in a class teaching C# using WPF. All of my previous experience has been in WinForms and this has lead to some interesting issues. The most interesting issue I've had is that WPF apparently doesn't have it's own OpenFileDialog class we are apparently supposed to use either System.Windows.Forms or Microsoft.Win32. It seems both work for the purpose of creating an Open File window however there are differences in the classes.

Using the System.Windows.Forms.OpenFileDialog causes name conflicts with various System.Windows.Controls.

e.g) There are buttons defined in each.

Using Microsoft.Win32 removes the ability to use DialogResult and instead Nullable<bool> is used.

Effectively I just want to know which one I should be using and why there isn't simply one control in System.Windows.Controls that is utilized across UI Types (Since it's just a wrapper around native code from what I understand).

Thanks in advance.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>