mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Settings - Update devices each time the tab opens
Readme - Clarified that we're not lazy :p
This commit is contained in:
1 parent
903e434137
commit
af496da647
2 files changed
+11
-4
No files matched your search
@@ -24,21 +24,28 @@ namespace Artemis.UI.Screens.Settings.Tabs.Devices
|
||||
_settingsVmFactory = settingsVmFactory;
|
||||
}
|
||||
|
||||
protected override void OnInitialActivate()
|
||||
#region Overrides of AllActive
|
||||
|
||||
/// <inheritdoc />
|
||||
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<DeviceSettingsViewModel> 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<bool> ShowDeviceDisableDialog()
|
||||
{
|
||||
if (_confirmedDisable)
|
||||
|
||||
Reference in new issue
Block a user