C#, WPF - OpenFileDialog does not appear

前端 未结 7 673
温柔的废话
温柔的废话 2020-12-09 20:54

I have been searching up and down the web and unfortunately never came across an issue quite like mine, so here goes:

My C# WPF application won\'t show me no OpenFil

7条回答
  •  生来不讨喜
    2020-12-09 21:32

    In the console application you will need STAThread appartment for it to work. But WPF is different.

    I would advise you using the File Dialogs only after the window starts and the Main Thread starts working. Try showing your dialog in some MainWindow event of its lifecycle.

提交回复
热议问题