dotnet / dotnet/wpf

Add support for controlling lifetime of navigation history elements

Open
#7,214 0 comments 0 reactions 0 assignees View on GitHub
Enhancement Requested
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

Currently we have no control over the elements in a `NavigationService`. Over time it eats a lot of memory. Best we can do is removing always the last element. The problem is that we may want to keep the last X elements but removing the oldest instead.

I suggest adding a way for developers to remove specific elements in the history. By giving us the opportunity to walk to the entire list and remove for example the first and 3rd one. Then 2nd becomes 1st, 4th becomes 2nd.

```C#
//Remove oldest / first one
this.NavigationService.RemoveAt(0);
// Remove previously 3rd which is now at position 2 after that we removed the first one.
this.NavigationService.RemoveAt(1);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.