Using FolderBrowserDialog in WPF application
You need to add a reference to System.Windows.Forms.dll, then use the System.Windows.Forms.FolderBrowserDialog class. Adding using WinForms = System.Windows.Forms; will be helpful.
You need to add a reference to System.Windows.Forms.dll, then use the System.Windows.Forms.FolderBrowserDialog class. Adding using WinForms = System.Windows.Forms; will be helpful.
Your code (or some code called by you) is making a call to a COM method which is returning an unknown value. If you can find that then you’re half way there. You could try breaking when the exception is thrown. Go to Debug > Exceptions… and use the Find… option to locate System.Runtime.InteropServices.COMException. Tick the option to break when … Read more
You can use WPF with C++/CLI. It is a .NET API, however, so it requires the .NET Framework. That being said, the designer support is non-existent with C++. This means that, for practical purposes, WPF doesn’t really work with C++. Typically, the user interface layer is written in C# (or VB.NET), then calls into C++ … Read more
If I create a new project in Visual Studio 2010 SP1 and select “WPF Application” and tries to build the generated application, I get the error The name ‘InitializeComponent’ does not exist in the current context. I got a similar error this morning when I tried to build my current project. Yesterday, I had no … Read more
To exit your application you can call As described in the documentation to the Application.Shutdown method you can also modify the shutdown behavior of your application by specifying a ShutdownMode: Shutdown is implicitly called by Windows Presentation Foundation (WPF) in the following situations: When ShutdownMode is set to OnLastWindowClose. When the ShutdownMode is set to OnMainWindowClose. When a … Read more
You can use a MultiBinding combined with the StringFormat property. Usage would resemble the following: Giving Name a value of Foo and ID a value of 1, your output in the TextBlock would then be Foo + 1. Note: This is only supported in .NET 3.5 SP1 and 3.0 SP2 or later.
Pages are intended for use in Navigation applications (usually with Back and Forward buttons, e.g. Internet Explorer). Pages must be hosted in a NavigationWindow or a Frame Windows are just normal WPF application Windows, but can host Pages via a Frame container
Screen.FromControl, Screen.FromPoint and Screen.FromRectangle should help you with this. For example in WinForms it would be: I don’t know of an equivalent call for WPF. Therefore, you need to do something like this extension method.
Add using Declare Background Worker: Subscribe to events: Implement two methods: Run worker async whenever your need. Track progress (optional, but often useful)a) subscribe to ProgressChanged event and use ReportProgress(Int32) in DoWorkb) set worker.WorkerReportsProgress = true; (credits to @zagy)
A ListView is basically like a ListBox (and inherits from it), but it also has a View property. This property allows you to specify a predefined way of displaying the items. The only predefined view in the BCL (Base Class Library) is GridView, but you can easily create your own. Another difference is the default selection mode: it’s Single for a ListBox, but Extended for a ListView