From 2b2ee8de20fe9b6f9f0d6632947fadf72dcd2d0b Mon Sep 17 00:00:00 2001
From: uye <99072975+ABA2396@users.noreply.github.com>
Date: Sat, 27 Jul 2024 00:40:25 +0800
Subject: [PATCH] =?UTF-8?q?chore:=20=E5=9B=BE=E7=89=87=E6=94=B9=E4=B8=BA?=
=?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ViewModels/UI/SettingsViewModel.cs | 30 ++++++++++++++-----
.../ConnectSettingsUserControl.xaml | 6 ----
2 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
index eebf8674c9..c5db94732f 100644
--- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
+++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
@@ -11,6 +11,7 @@
// but WITHOUT ANY WARRANTY
//
+#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -28,6 +29,7 @@ using System.Runtime.InteropServices.ComTypes;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
+using System.Windows.Controls;
using System.Windows.Media.Imaging;
using HandyControl.Controls;
using HandyControl.Data;
@@ -53,6 +55,7 @@ using Stylet;
using ComboBox = System.Windows.Controls.ComboBox;
using DarkModeType = MaaWpfGui.Configuration.GUI.DarkModeType;
using Timer = System.Timers.Timer;
+using Window = HandyControl.Controls.Window;
namespace MaaWpfGui.ViewModels.UI
{
@@ -4105,14 +4108,25 @@ namespace MaaWpfGui.ViewModels.UI
TestLinkImage = Instances.AsstProxy.AsstGetImage();
TestLinkInfo = "Finish";
Instances.AsstProxy.AsstStop();
- }
-
- private bool _showTestLinkImage = false;
-
- public bool ShowTestLinkImage
- {
- get => _showTestLinkImage;
- set => SetAndNotify(ref _showTestLinkImage, value);
+ if (TestLinkImage is null)
+ {
+ TestLinkInfo = "Image is null";
+ }
+ else
+ {
+ Window popupWindow = new Window
+ {
+ Width = TestLinkImage.PixelWidth,
+ Height = TestLinkImage.PixelHeight,
+ Content = new Image
+ {
+ Width = TestLinkImage.PixelWidth,
+ Height = TestLinkImage.PixelHeight,
+ Source = TestLinkImage
+ }
+ };
+ popupWindow.ShowDialog();
+ }
}
private BitmapImage? _testLinkImage;
diff --git a/src/MaaWpfGui/Views/UserControl/ConnectSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/ConnectSettingsUserControl.xaml
index e30bab88bf..c260cb9531 100644
--- a/src/MaaWpfGui/Views/UserControl/ConnectSettingsUserControl.xaml
+++ b/src/MaaWpfGui/Views/UserControl/ConnectSettingsUserControl.xaml
@@ -170,12 +170,6 @@
Command="{s:Action TestLinkAndGetImage}"
Content="Test" />
-