chore: 图片改为弹窗显示

This commit is contained in:
uye
2024-07-27 00:40:25 +08:00
parent 8b4b21df75
commit 2b2ee8de20
2 changed files with 22 additions and 14 deletions

View File

@@ -11,6 +11,7 @@
// but WITHOUT ANY WARRANTY
// </copyright>
#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;

View File

@@ -170,12 +170,6 @@
Command="{s:Action TestLinkAndGetImage}"
Content="Test" />
</StackPanel>
<Image
Margin="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Source="{Binding TestLinkImage}"
Visibility="{c:Binding 'TestLinkInfo!=&quot;&quot;'}" />
<controls:TextBlock
Margin="10"
HorizontalAlignment="Center"