|
|
@ -1,9 +1,7 @@ |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Avalonia.Controls; |
|
|
|
using Avalonia.Controls; |
|
|
|
using Avalonia.Controls.Primitives; |
|
|
|
|
|
|
|
using Avalonia.Media.Imaging; |
|
|
|
using Avalonia.Media.Imaging; |
|
|
|
using CommunityToolkit.Mvvm.Input; |
|
|
|
using CommunityToolkit.Mvvm.Input; |
|
|
|
using FluentAvalonia.UI.Controls; |
|
|
|
|
|
|
|
using StabilityMatrix.Avalonia.Helpers; |
|
|
|
using StabilityMatrix.Avalonia.Helpers; |
|
|
|
using StabilityMatrix.Core.Helper; |
|
|
|
using StabilityMatrix.Core.Helper; |
|
|
|
|
|
|
|
|
|
|
@ -16,18 +14,9 @@ public partial class AdvancedImageBoxView : UserControl |
|
|
|
InitializeComponent(); |
|
|
|
InitializeComponent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
public static AsyncRelayCommand<Bitmap?> FlyoutCopyCommand { get; } = new(FlyoutCopy); |
|
|
|
protected override void OnApplyTemplate(TemplateAppliedEventArgs e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
base.OnApplyTemplate(e); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.FindControl<MenuFlyoutItem>("CopyMenuItem") is { } copyMenuItem) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
copyMenuItem.Command = new AsyncRelayCommand<Bitmap?>(FlyoutCopy); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static async Task FlyoutCopy(Bitmap? image) |
|
|
|
public static async Task FlyoutCopy(Bitmap? image) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (image is null || !Compat.IsWindows) |
|
|
|
if (image is null || !Compat.IsWindows) |
|
|
|
return; |
|
|
|
return; |
|
|
|