mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Added some views, I really just need this code on adifferent machine
This commit is contained in:
1 parent
2330644062
commit
1ae5a18c8e
20 files changed
+267
-117
No files matched your search
@@ -8,6 +8,7 @@ using Artemis.Core.Plugins.Interfaces;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Artemis.UI.ViewModels.Settings;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using Humanizer;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Settings
|
||||
{
|
||||
public class DeviceSettingsViewModel
|
||||
{
|
||||
private readonly IRGBDevice _device;
|
||||
|
||||
public DeviceSettingsViewModel(IRGBDevice device)
|
||||
{
|
||||
_device = device;
|
||||
|
||||
Type = _device.DeviceInfo.DeviceType.ToString().Humanize();
|
||||
Name = _device.DeviceInfo.Model;
|
||||
Manufacturer = _device.DeviceInfo.Manufacturer;
|
||||
Enabled = true;
|
||||
}
|
||||
|
||||
public string Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using Artemis.Core.Events;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Settings
|
||||
{
|
||||
public class SettingsViewModel : Screen, ISettingsViewModel
|
||||
{
|
||||
public string Title => "Settings";
|
||||
|
||||
public SettingsViewModel(IRgbService rgbService)
|
||||
{
|
||||
DeviceSettingsViewModels = new List<DeviceSettingsViewModel>();
|
||||
foreach (var device in rgbService.Surface.Devices)
|
||||
DeviceSettingsViewModels.Add(new DeviceSettingsViewModel(device));
|
||||
|
||||
rgbService.DeviceLoaded += UpdateDevices;
|
||||
}
|
||||
|
||||
public List<DeviceSettingsViewModel> DeviceSettingsViewModels { get; set; }
|
||||
|
||||
private void UpdateDevices(object sender, DeviceEventArgs deviceEventArgs)
|
||||
{
|
||||
DeviceSettingsViewModels.Add(new DeviceSettingsViewModel(deviceEventArgs.Device));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels
|
||||
{
|
||||
public class SettingsViewModel : Screen, ISettingsViewModel
|
||||
{
|
||||
public string Title => "Settings";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user