Skip to content

Commit c5dd19e

Browse files
committed
Use Microsoft.Win32.OpenFileDialog instead
1 parent 135fd03 commit c5dd19e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
5-
using System.Windows.Forms;
65
using CommunityToolkit.Mvvm.Input;
76
using Flow.Launcher.Helper;
87
using Flow.Launcher.Plugin;
@@ -112,7 +111,7 @@ private async Task InstallPluginAsync()
112111

113112
private static string GetFileFromDialog(string title, string filter = "")
114113
{
115-
var dlg = new OpenFileDialog
114+
var dlg = new Microsoft.Win32.OpenFileDialog
116115
{
117116
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\Downloads",
118117
Multiselect = false,
@@ -121,12 +120,11 @@ private static string GetFileFromDialog(string title, string filter = "")
121120
Title = title,
122121
Filter = filter
123122
};
123+
var result = dlg.ShowDialog();
124+
if (result == true)
125+
return dlg.FileName;
124126

125-
return dlg.ShowDialog() switch
126-
{
127-
DialogResult.OK => dlg.FileName,
128-
_ => string.Empty
129-
};
127+
return string.Empty;
130128
}
131129

132130
public bool SatisfiesFilter(PluginStoreItemViewModel plugin)

0 commit comments

Comments
 (0)