Skip to content

Commit

Permalink
Fix actions value loading
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszCichecki committed Aug 20, 2023
1 parent 1aa9b51 commit 2401feb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public Task<Delay[]> GetAllStatesAsync() => Task.FromResult(new Delay[] {
new(1),
new(2),
new(3),
new(5)
});

public IAutomationStep DeepCopy() => new DelayAutomationStep(State);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ protected AbstractAutomationStepControl(IAutomationStep automationStep)
InitializeComponent();

Loaded += RefreshingControl_Loaded;
IsVisibleChanged += RefreshingControl_IsVisibleChanged;
}

private void InitializeComponent()
Expand All @@ -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();
Expand Down

0 comments on commit 2401feb

Please sign in to comment.