Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/AvaloniaInside.Shell/StackContentView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@

// Bring to front if exists in collection
if (Children.Contains(control))
Children.Remove(control);
Children.Add(control);
{
var currentIndex = Children.IndexOf(control);
if (currentIndex != Children.Count - 1)
{
Children.Move(currentIndex, Children.Count - 1);
}
}
else
{
Children.Add(control);
}

await OnContentUpdateAsync(control, cancellationToken);
await UpdateCurrentViewAsync(current, control, navigateType, false, cancellationToken);
Expand Down Expand Up @@ -102,7 +111,7 @@
await UpdateCurrentViewAsync(view, to, navigateType, true, cancellationToken);
}

Children.Remove(view as Control);

Check warning on line 114 in src/AvaloniaInside.Shell/StackContentView.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'item' in 'bool AvaloniaList<Control>.Remove(Control item)'.
await OnContentUpdateAsync(CurrentView, cancellationToken);

RaisePropertyChanged(CurrentViewProperty, current, CurrentView);
Expand Down
Loading