Question

In the application I'm working on, I've been trying to use the SaveFileDialog and OpenFileDialog for their customary purpose (saving and opening files.)

However, the application can't support modal forms/dialogs without crashing because too many time-sensitive things happen on the thread that owns the UI.

Rewriting the application to move those features off the UI-owning thread is not practical in the immediate term. To finish the feature I've been working on, I need a substitute for the two file dialogs, preferably a control that can live on a non-modal form.

Is there anything out there I can use that won't block my UI-owning thread?

Was it helpful?

Solution

The only existing option I know of is Dialog Workshop.NET, a commercial product. They have a set of dialogs that have the option of being modeless (or embedded directly into a windows form instead of a separate window).

However, I'd really think about trying to move your time sensitive logic into a separate thread, instead. Having a modeless dialog will potentially confuse users, since it will not behave the way a file dialog is supposed to behave. There are also other potential consequences to having a non-blockable UI.

OTHER TIPS

too many time-sensitive things happen on the thread that owns the UI.

That is your real problem. .Net has very robust multi-threading support. I suggest you move these things elsewhere, unpleasant though it seems. It's probably less work than re-implementing the Open/Save dialogs and definitely will be less for your app in the long run.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top