mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 11:39:16 +08:00
b22a4501cc
1. introduce variable 2. part of #389 3. refactoring program suffix in program plugin 4. 全局变量一时爽,代码重构火葬场
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Wox.Plugin.CMD
|
|
{
|
|
public partial class CMDSetting : UserControl
|
|
{
|
|
private readonly CMDStorage _settings;
|
|
|
|
public CMDSetting(CMDStorage settings)
|
|
{
|
|
InitializeComponent();
|
|
_settings = settings;
|
|
}
|
|
|
|
private void CMDSetting_OnLoaded(object sender, RoutedEventArgs re)
|
|
{
|
|
cbReplaceWinR.IsChecked = _settings.ReplaceWinR;
|
|
cbLeaveCmdOpen.IsChecked = _settings.LeaveCmdOpen;
|
|
|
|
cbLeaveCmdOpen.Checked += (o, e) =>
|
|
{
|
|
_settings.LeaveCmdOpen = true;
|
|
_settings.Save();
|
|
};
|
|
|
|
cbLeaveCmdOpen.Unchecked += (o, e) =>
|
|
{
|
|
_settings.LeaveCmdOpen = false;
|
|
_settings.Save();
|
|
};
|
|
|
|
cbReplaceWinR.Checked += (o, e) =>
|
|
{
|
|
_settings.ReplaceWinR = true;
|
|
_settings.Save();
|
|
};
|
|
cbReplaceWinR.Unchecked += (o, e) =>
|
|
{
|
|
_settings.ReplaceWinR = false;
|
|
_settings.Save();
|
|
};
|
|
}
|
|
}
|
|
}
|