UI - Use Timer instead of DispatcherTimer where feasible

This commit is contained in:
Robert committed 2023-05-20 23:11:51 +02:00
1 parent 4ffe8d8848
commit fa710777d7
7 files changed
+42 -52

No files matched your search

@@ -34,7 +34,7 @@ public class DeviceVisualizer : Control
/// <inheritdoc />
public DeviceVisualizer()
{
_timer = new DispatcherTimer(DispatcherPriority.Render) {Interval = TimeSpan.FromMilliseconds(1000.0 / UpdateFrameRate)};
_timer = new DispatcherTimer(DispatcherPriority.Background) {Interval = TimeSpan.FromMilliseconds(1000.0 / UpdateFrameRate)};
_deviceVisualizerLeds = new List<DeviceVisualizerLed>();
PointerReleased += OnPointerReleased;
@@ -78,6 +78,6 @@ public class OpenFileDialogBuilder
public async Task<string[]?> ShowAsync()
{
IReadOnlyList<IStorageFile> files = await _parent.StorageProvider.OpenFilePickerAsync(_options);
return files.Select(f => f.Path.LocalPath).ToArray();
return files.Count == 0 ? null : files.Select(f => f.Path.LocalPath).ToArray();
}
}