mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System.Threading.Tasks;
|
|
using Artemis.Core;
|
|
using Artemis.UI.Shared;
|
|
using Artemis.UI.Shared.Services;
|
|
using Avalonia;
|
|
using RGB.NET.Core;
|
|
|
|
namespace Artemis.UI.Screens.Device;
|
|
|
|
public class DeviceInfoTabViewModel : ActivatableViewModelBase
|
|
{
|
|
private readonly INotificationService _notificationService;
|
|
|
|
public DeviceInfoTabViewModel(ArtemisDevice device, INotificationService notificationService)
|
|
{
|
|
_notificationService = notificationService;
|
|
|
|
Device = device;
|
|
DisplayName = "Info";
|
|
|
|
DefaultLayoutPath = Device.DeviceProvider.LoadLayout(Device).FilePath;
|
|
}
|
|
|
|
public bool IsKeyboard => Device.DeviceType == RGBDeviceType.Keyboard;
|
|
public ArtemisDevice Device { get; }
|
|
|
|
public string DefaultLayoutPath { get; }
|
|
|
|
public async Task CopyToClipboard(string content)
|
|
{
|
|
if (Application.Current?.Clipboard == null)
|
|
return;
|
|
|
|
await Application.Current.Clipboard.SetTextAsync(content);
|
|
_notificationService.CreateNotification().WithMessage("Copied path to clipboard.").Show();
|
|
}
|
|
} |