From af496da64717d0e6eb1ef15fcbe592e8d92f50a6 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 8 Apr 2021 20:54:34 +0200 Subject: [PATCH] Settings - Update devices each time the tab opens Readme - Clarified that we're not lazy :p --- README.md | 2 +- .../Tabs/Devices/DeviceSettingsTabViewModel.cs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 064e062dd..c66d69d0c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Artemis 1 is no longer supported and Artemis 2 is in active development. This en **Pre-release download**: https://github.com/SpoinkyNL/Artemis/releases (pre-release means your profiles may break at any given time!) **Plugin documentation**: https://artemis-rgb.com/docs/ -**Please note that even though we have plugins for each brand supported by RGB.NET, they have not been thoroughly tested. If you run into any issues please let us know on Discord.** +**Please note that even though we have plugins for each brand supported by RGB.NET, they have not been thoroughly tested due to a lack of hardware. If you run into any issues please let us know on Discord.** A full list of supported devices can be found on the wiki [here](https://wiki.artemis-rgb.com/en/guides/user/devices). #### Want to build? Follow these instructions diff --git a/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabViewModel.cs b/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabViewModel.cs index e3cb174a6..ee9c2f793 100644 --- a/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabViewModel.cs @@ -24,21 +24,28 @@ namespace Artemis.UI.Screens.Settings.Tabs.Devices _settingsVmFactory = settingsVmFactory; } - protected override void OnInitialActivate() + #region Overrides of AllActive + + /// + protected override void OnActivate() { // Take it off the UI thread to avoid freezing on tab change Task.Run(async () => { + if (Items.Any()) + Items.Clear(); + await Task.Delay(200); List instances = _rgbService.Devices.Select(d => _settingsVmFactory.CreateDeviceSettingsViewModel(d)).ToList(); foreach (DeviceSettingsViewModel deviceSettingsViewModel in instances) Items.Add(deviceSettingsViewModel); }); - - base.OnInitialActivate(); + base.OnActivate(); } + #endregion + public async Task ShowDeviceDisableDialog() { if (_confirmedDisable)