我在我的WPF应用程序中使用Microsoft.Win32.OpenFileDialog
来选择文件:
var dlg = new Microsoft.Win32.OpenFileDialog
{
Title = "Select configuration",
DefaultExt = ".xml",
Filter = "XML-file (.xml)|*.xml",
CheckFileExists = true
};
if (dlg.ShowDialog() == true)
{
//...
}
根据MSDN上的Windows 7截图,对话框应该具有现代风格,但我得到的是旧版的:
像this问题中添加清单并不起作用。如何获得类似于MSDN中显示的对话框?
编辑:
首先,我对“本地”解决方案感兴趣,而不是使用第三方组件。