This commit is contained in:
wule committed 2026-10-29 11:31:19 +08:00
commit 9545de7684
3 files changed
+25 -1

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@ namespace AllBase
/// 版本ID
/// </summary>
public static int VersionCount = 365;
public static int VersionCount = 367;
//public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
public static string ServerUrl
@@ -164,6 +164,11 @@
CornerRadius="5"
Cursor="Hand"
ToolTip="{Binding ToolTipText}">
<Border.ContextMenu>
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
<MenuItem Header="复制图片" Click="CopyImage_Click" />
</ContextMenu>
</Border.ContextMenu>
<Border.InputBindings>
<MouseBinding
Command="{Binding Source={StaticResource ShowImageCommand}}"
@@ -1,7 +1,9 @@
using _29WxOrderWpf.ToolCtrls;
using OrderSupportTicket.ViewModels;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using Work._29Tools.Forms.ToolForms;
namespace OrderSupportTicket.Views;
@@ -9,6 +11,23 @@ namespace OrderSupportTicket.Views;
public partial class TicketConversationView : UserControl
{
public TicketConversationView() => InitializeComponent();
private void CopyImage_Click(object sender, RoutedEventArgs e)
{
e.Handled = true;
var window = Window.GetWindow(this);
if (window == null) return;
if (sender is not MenuItem { DataContext: ChatAttachmentViewModel attachment }) return;
if (attachment.Image is not BitmapSource bitmap)
{
ToastHelper.Show(window, "图片尚未加载成功,无法复制");
return;
}
var data = new DataObject(DataFormats.Bitmap, bitmap);
ToastHelper.Show(window, ClipboardHelper.TrySetData(data) ? "图片已复制" : "图片复制失败,请重试");
}
private void CopyOrderId_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (sender is not FrameworkElement element || element.Tag is not string orderId || string.IsNullOrWhiteSpace(orderId)) return;