/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/FileSystem/Transfer/BaseTransferItemAction.cs
32 строки
1 KB
d2dyno
Code Quality: Continued working on Shelf Pane (#17308)
04 май 2026, 07:57
Не верифицирован
04 май 2026, 07:57
2968da7
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. using Windows.ApplicationModel.DataTransfer; namespace Files.App.Actions { internal abstract class BaseTransferItemAction : ObservableObject { protected readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService<IContentPageContext>(); protected readonly StatusCenterViewModel StatusCenterViewModel = Ioc.Default.GetRequiredService<StatusCenterViewModel>(); public bool IsExecutable => ContentPageContext.HasSelection; public BaseTransferItemAction() { ContentPageContext.PropertyChanged += ContentPageContext_PropertyChanged; } public async Task ExecuteTransferAsync(DataPackageOperation type = DataPackageOperation.Copy) { await TransferHelpers.ExecuteTransferAsync(ContentPageContext, StatusCenterViewModel, type); } private void ContentPageContext_PropertyChanged(object? sender, PropertyChangedEventArgs e) { if (e.PropertyName is nameof(IContentPageContext.HasSelection)) OnPropertyChanged(nameof(IsExecutable)); } } }