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

Device visualizer - Clear device cache on UI thread on property change

Surface editor - Don't quietly fail device updates
This commit is contained in:
Robert 2023-07-09 08:29:54 +02:00
parent 850038ffd1
commit af1920141c
2 changed files with 10 additions and 3 deletions

View File

@ -197,9 +197,12 @@ public class DeviceVisualizer : Control
private void DevicePropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (Device != null)
BitmapCache.Remove(Device);
Dispatcher.UIThread.Invoke(SetupForDevice, DispatcherPriority.Background);
Dispatcher.UIThread.Invoke(async () =>
{
if (Device != null)
BitmapCache.Remove(Device);
await SetupForDevice();
}, DispatcherPriority.Background);
}
private void DeviceUpdated(object? sender, EventArgs e)

View File

@ -136,6 +136,10 @@ public class SurfaceEditorViewModel : ActivatableViewModelBase, IMainScreenViewM
_saving = true;
_rgbService.SaveDevices();
}
catch (Exception e)
{
_windowService.ShowExceptionDialog("Failed to update device positions", e);
}
finally
{
_saving = false;