Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixed issue where it didn't work to create a shortcut unless an item is selected #11768

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/Files.App/Actions/FileSystem/CreateShortcutFromDialogAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Files.App.Contexts;
using Files.App.Extensions;
using Files.App.Helpers;
using System.ComponentModel;
using System.Threading.Tasks;

namespace Files.App.Actions
Expand All @@ -17,23 +16,10 @@ internal class CreateShortcutFromDialogAction : ObservableObject, IAction

public RichGlyph Glyph { get; } = new RichGlyph(opacityStyle: "ColorIconShortcut");

public bool IsExecutable => context.HasSelection;

public CreateShortcutFromDialogAction()
{
context.PropertyChanged += Context_PropertyChanged;
}

public async Task ExecuteAsync()
{
if (context.ShellPage is not null)
await UIFilesystemHelpers.CreateShortcutFromDialogAsync(context.ShellPage);
}

private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName is nameof(IContentPageContext.HasSelection))
OnPropertyChanged(nameof(IsExecutable));
}
}
}