I'm converting a windows forms application to a WPF application. Is there a way to obtain things like, Startup Path, User App Data Path, Common App Data Path, etc. without referencing System.Windows.Forms?
Previously, I used System.Windows.Forms.Application.StartupPath
, but the System.Windows.Application.Current
object doesn't contain the same information.
Introduction. The abbreviation W.P.F simply refers to Microsoft's Windows Presentation Foundation, and WinForms is a simple concatenation of Windows Forms Applications. These are both Microsoft's Windows Applications Graphical User Interfaces that developers may use to develop Windows desktop applications.
Advantages of using WPF instead of Windows forms: XAML makes it easy to create and edit your GUI, and allows the work to be split between a designer (XAML) and a programmer (C#, VB.NET etc.). It allows you to make user interfaces for both Windows applications and web applications (Silverlight/XBAP).
Windows forms are mainly based on a pixel, whereas WPF is not pixel-based, which allows the scalability of the UI part for the application. Windows forms support data binding in a limited way, whereas WPF is fully supported data binding.
Windows Presentation Foundation (WPF) is a UI framework that creates desktop client applications. The WPF development platform supports a broad set of application development features, including an application model, resources, controls, graphics, layout, data binding, documents, and security.
You might want to look at System.Environment.GetFolderPath
.
The values of the SpecialFolder
enum are numerous:
ApplicationData CommonApplicationData CommonProgramFiles Cookies Desktop DesktopDirectory Favorites History InternetCache LocalApplicationData MyComputer MyDocuments MyMusic MyPictures Personal ProgramFiles Programs Recent SendTo StartMenu Startup System Templates
Is that helpful?
this will help
for Application.StartupPath use AppDomain.CurrentDomain.BaseDirectory
http://msdn.microsoft.com/en-us/library/system.appdomain.basedirectory.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With