Skip to content

Commit

Permalink
Use native OpenFolderDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Nov 14, 2023
1 parent 63b5f7d commit 51a24bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions YoutubeDownloader/ViewModels/Framework/DialogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading;
using System.Threading.Tasks;
using MaterialDesignThemes.Wpf;
using Ookii.Dialogs.Wpf;
using Microsoft.Win32;
using Stylet;

namespace YoutubeDownloader.ViewModels.Framework;
Expand Down Expand Up @@ -55,7 +55,7 @@ void OnScreenClosed(object? closeSender, EventArgs closeArgs)

public string? PromptSaveFilePath(string filter = "All files|*.*", string defaultFilePath = "")
{
var dialog = new VistaSaveFileDialog
var dialog = new SaveFileDialog
{
Filter = filter,
AddExtension = true,
Expand All @@ -68,9 +68,8 @@ void OnScreenClosed(object? closeSender, EventArgs closeArgs)

public string? PromptDirectoryPath(string defaultDirPath = "")
{
var dialog = new VistaFolderBrowserDialog { SelectedPath = defaultDirPath };

return dialog.ShowDialog() == true ? dialog.SelectedPath : null;
var dialog = new OpenFolderDialog { InitialDirectory = defaultDirPath };
return dialog.ShowDialog() == true ? dialog.FolderName : null;
}

public void Dispose()
Expand Down
1 change: 0 additions & 1 deletion YoutubeDownloader/YoutubeDownloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2151.40" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageReference Include="Onova" Version="2.6.10" />
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" PrivateAssets="all" />
<PackageReference Include="Stylet" Version="1.3.6" />
</ItemGroup>
Expand Down

0 comments on commit 51a24bd

Please sign in to comment.