From 2829a5701d87812a7779ccdda135273c275dcc94 Mon Sep 17 00:00:00 2001
From: uye <99072975+ABA2396@users.noreply.github.com>
Date: Tue, 6 Aug 2024 00:59:40 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9F=BA=E5=BB=BA=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E5=85=A8/=E5=8F=8D=E9=80=89=20=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=EF=BC=8C=E5=88=97=E8=A1=A8=E5=8C=BA=E5=9F=9F=E5=8F=AF?=
=?UTF-8?q?=E5=93=8D=E5=BA=94=E6=BB=9A=E5=8A=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
fix #10102
---
.../ViewModels/UI/SettingsViewModel.cs | 20 +++++++++++++
.../InfrastSettingsUserControl.xaml | 28 ++++++++++++++++++-
.../InfrastSettingsUserControl.xaml.cs | 20 +++++++++++++
3 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
index d2f8ea30e7..e3eef59857 100644
--- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
+++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
@@ -1476,6 +1476,26 @@ namespace MaaWpfGui.ViewModels.UI
return (from item in InfrastItemViewModels where item.IsChecked select item.OriginalName).ToList();
}
+ // UI 绑定的方法
+ // ReSharper disable once UnusedMember.Global
+ public void InfrastItemSelectedAll()
+ {
+ foreach (var item in InfrastItemViewModels)
+ {
+ item.IsChecked = true;
+ }
+ }
+
+ // UI 绑定的方法
+ // ReSharper disable once UnusedMember.Global
+ public void InfrastItemUnselectedAll()
+ {
+ foreach (var item in InfrastItemViewModels)
+ {
+ item.IsChecked = false;
+ }
+ }
+
///
/// 实时更新基建换班顺序
///
diff --git a/src/MaaWpfGui/Views/UserControl/InfrastSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/InfrastSettingsUserControl.xaml
index 90c7c0c474..05f585fe32 100644
--- a/src/MaaWpfGui/Views/UserControl/InfrastSettingsUserControl.xaml
+++ b/src/MaaWpfGui/Views/UserControl/InfrastSettingsUserControl.xaml
@@ -115,11 +115,37 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/MaaWpfGui/Views/UserControl/InfrastSettingsUserControl.xaml.cs b/src/MaaWpfGui/Views/UserControl/InfrastSettingsUserControl.xaml.cs
index 6f483ce48e..b24dcb9ab4 100644
--- a/src/MaaWpfGui/Views/UserControl/InfrastSettingsUserControl.xaml.cs
+++ b/src/MaaWpfGui/Views/UserControl/InfrastSettingsUserControl.xaml.cs
@@ -11,6 +11,10 @@
// but WITHOUT ANY WARRANTY
//
+using System.Windows.Input;
+using System.Windows;
+using System.Windows.Controls;
+
namespace MaaWpfGui.Views.UserControl
{
///
@@ -25,5 +29,21 @@ namespace MaaWpfGui.Views.UserControl
{
InitializeComponent();
}
+
+ private void ListBox_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
+ {
+ if (e.Handled)
+ {
+ return;
+ }
+
+ e.Handled = true;
+ var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta)
+ {
+ RoutedEvent = UIElement.MouseWheelEvent
+ };
+ var parent = ((Control)sender).Parent as UIElement;
+ parent?.RaiseEvent(eventArg);
+ }
}
}