/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/WinGetOperationsButton.xaml.cs
37 строк
1 KB
Jiří Polášek
CmdPal: Extension Gallery - Fix WMC1506 warnings (#47899)
16 май 2026, 20:59
Не верифицирован
16 май 2026, 20:59
012fb4a
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.CmdPal.Common.WinGet.Services; using Microsoft.CmdPal.UI.ViewModels.WinGet; using Microsoft.Extensions.DependencyInjection; using Microsoft.UI.Xaml.Controls; namespace Microsoft.CmdPal.UI.Controls; public sealed partial class WinGetOperationsButton : UserControl, IDisposable { private bool _disposed; public WinGetOperationsViewModel ViewModel { get; } public WinGetOperationsButton() { var trackerService = App.Current.Services.GetRequiredService<IWinGetOperationTrackerService>(); var uiScheduler = App.Current.Services.GetService<TaskScheduler>() ?? TaskScheduler.FromCurrentSynchronizationContext(); ViewModel = new WinGetOperationsViewModel(trackerService, uiScheduler); this.InitializeComponent(); } public void Dispose() { if (_disposed) { return; } _disposed = true; ViewModel.Dispose(); } }