mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Core - Fix an access violation on surface changes (when loading device providers/moving devices)
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using Artemis.Core.Services;
|
|
using Stylet;
|
|
|
|
namespace Artemis.UI.Screens.StartupWizard.Steps
|
|
{
|
|
public class LayoutStepViewModel : Screen
|
|
{
|
|
private readonly IRgbService _rgbService;
|
|
|
|
public LayoutStepViewModel(IRgbService rgbService)
|
|
{
|
|
_rgbService = rgbService;
|
|
}
|
|
|
|
public void ApplyLeftHandedPreset()
|
|
{
|
|
_rgbService.AutoArrangeDevices();
|
|
StartupWizardViewModel startupWizardViewModel = (StartupWizardViewModel) Parent;
|
|
startupWizardViewModel.Continue();
|
|
}
|
|
|
|
public void ApplyRightHandedPreset()
|
|
{
|
|
_rgbService.AutoArrangeDevices();
|
|
StartupWizardViewModel startupWizardViewModel = (StartupWizardViewModel) Parent;
|
|
startupWizardViewModel.Continue();
|
|
}
|
|
|
|
#region Overrides of Screen
|
|
|
|
/// <inheritdoc />
|
|
protected override void OnActivate()
|
|
{
|
|
_rgbService.SetRenderPaused(true);
|
|
base.OnActivate();
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void OnDeactivate()
|
|
{
|
|
_rgbService.SetRenderPaused(false);
|
|
base.OnDeactivate();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |