1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 13:28:33 +00:00

Early return when copying isn't possible

This commit is contained in:
Diogo Trindade 2023-08-19 19:10:03 +01:00
parent 4223879e72
commit 6a02d5031b

View File

@ -16,13 +16,19 @@ public partial class DeviceLayoutTabView : ReactiveUserControl<DeviceLayoutTabVi
private void LayoutPathButton_OnClick(object? sender, RoutedEventArgs e)
{
TopLevel.GetTopLevel(this).Clipboard.SetTextAsync(ViewModel?.DefaultLayoutPath ?? string.Empty);
if (ViewModel?.DefaultLayoutPath is null)
return;
TopLevel.GetTopLevel(this).Clipboard.SetTextAsync(ViewModel.DefaultLayoutPath);
ViewModel.ShowCopiedNotification();
}
private void ImagePathButton_OnClick(object? sender, RoutedEventArgs e)
{
TopLevel.GetTopLevel(this).Clipboard.SetTextAsync(ViewModel?.Device?.Layout?.Image?.LocalPath ?? string.Empty);
if (ViewModel?.Device?.Layout?.Image?.LocalPath is null)
return;
TopLevel.GetTopLevel(this).Clipboard.SetTextAsync(ViewModel.Device.Layout.Image.LocalPath);
ViewModel.ShowCopiedNotification();
}
}