diff --git a/LenovoLegionToolkit.Lib.Automation/Steps/DelayAutomationStep.cs b/LenovoLegionToolkit.Lib.Automation/Steps/DelayAutomationStep.cs index 1a3547a9b9..b095c8499c 100644 --- a/LenovoLegionToolkit.Lib.Automation/Steps/DelayAutomationStep.cs +++ b/LenovoLegionToolkit.Lib.Automation/Steps/DelayAutomationStep.cs @@ -17,6 +17,7 @@ public Task GetAllStatesAsync() => Task.FromResult(new Delay[] { new(1), new(2), new(3), + new(5) }); public IAutomationStep DeepCopy() => new DelayAutomationStep(State); diff --git a/LenovoLegionToolkit.WPF/Controls/Automation/AbstractAutomationStepControl.cs b/LenovoLegionToolkit.WPF/Controls/Automation/AbstractAutomationStepControl.cs index 890be92342..c0ae0d8d0b 100644 --- a/LenovoLegionToolkit.WPF/Controls/Automation/AbstractAutomationStepControl.cs +++ b/LenovoLegionToolkit.WPF/Controls/Automation/AbstractAutomationStepControl.cs @@ -68,7 +68,6 @@ protected AbstractAutomationStepControl(IAutomationStep automationStep) InitializeComponent(); Loaded += RefreshingControl_Loaded; - IsVisibleChanged += RefreshingControl_IsVisibleChanged; } private void InitializeComponent() @@ -86,17 +85,12 @@ private void InitializeComponent() Content = _cardControl; } - private void RefreshingControl_Loaded(object sender, RoutedEventArgs e) + private async void RefreshingControl_Loaded(object sender, RoutedEventArgs e) { + await RefreshAsync(); OnFinishedLoading(); } - private async void RefreshingControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) - { - if (IsVisible) - await RefreshAsync(); - } - public abstract IAutomationStep CreateAutomationStep(); protected abstract UIElement? GetCustomControl();