在WPF SaveFileDialog错误 [英] SaveFileDialog bug in WPF

查看:145
本文介绍了在WPF SaveFileDialog错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 Microsoft.Win32.SaveFileDialog 类来保存我的文件。当我保存的文件,并最大限度地减少我的应用程序,我无法恢复回来。它仅用于后会发生 Microsoft.Win32.SaveFileDialog 。这里是code:

I'm using Microsoft.Win32.SaveFileDialog class to save my files. When I saved file, and minimize my app, I can't restore it back. It happens only after when used Microsoft.Win32.SaveFileDialog. Here is code:

Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
dlg.FileName = String.Format("{0} {1} {2}", ev["b"], ev["a"], ev["c"]);
dlg.DefaultExt = ".csv";
dlg.Filter = "Supported format (.csv)|*.csv";
Nullable<bool> result = dlg.ShowDialog();
if (result == true)
{
    string s = dlg.FileName;
    //other code
}

文件成功保存,但我不知道如何解决问题,最大限度地减少。有谁知道可能是什么?

File saves successfully, but I don't know how to solve problem with minimizing. Does anybody knows what it could be?

推荐答案

WPF有各种奇怪的方式问题,当您显示的对话框没有父窗口。我还没有与SaveFileDialog看到了这一点直接,但我已经看到了与其它对话框类似的行为。尝试使用.ShowDialog(),您传递父窗口的过载。

WPF has all kinds of weird modality issues when you show dialogs without parent windows. I haven't seen this directly with the SaveFileDialog, but I have seen similar behavior with other dialogs. Try using the overload of .ShowDialog() where you pass in the parent window.

这篇关于在WPF SaveFileDialog错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆