2
0

新增DELL 螢幕控制開關

This commit is contained in:
DangHome
2023-07-02 22:17:57 +08:00
parent f0b02be1a5
commit a48d7b8d56
16 changed files with 850 additions and 137 deletions

View File

@@ -0,0 +1,40 @@
using CMM.Library.Method;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
namespace DellMonitorControl;
/// <summary>
/// Interaction logic for ControlPanel.xaml
/// </summary>
public partial class ControlPanel : UserControl
{
public ControlPanel()
{
InitializeComponent();
}
private void Border_MouseLeave(object sender, MouseEventArgs e)
{
}
private async void ToggleButton_Checked(object sender, RoutedEventArgs e)
{
var toggle = sender as Button;
var tag = toggle?.Tag.ToString();
var content = toggle?.Content as string;
if (content == "Sleep")
{
await CMMCommand.Sleep(tag);
toggle!.Content = "PowerOn";
}
else
{
await CMMCommand.PowerOn(tag);
toggle!.Content = "Sleep";
}
}
}