Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabView throw ArgumentOutOfRange exception when TabItemSource is cleared #3104

Closed
Psykobal opened this issue Aug 12, 2020 · 2 comments · Fixed by #3118
Closed

TabView throw ArgumentOutOfRange exception when TabItemSource is cleared #3104

Psykobal opened this issue Aug 12, 2020 · 2 comments · Fixed by #3118
Labels
area-TabView team-Controls Issue for the Controls team

Comments

@Psykobal
Copy link

Describe the bug
If you clear an ObservableCollection attached to TabItemsSource, app will crash with ArgumentOutOfRangeException

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Open XamlControlsGallery project

  2. Modify private void TabViewItemsSourceSample_AddTabButtonClick(TabView sender, object args) in TabViewPage.xaml.cs as follow:
    myDatas.Clear();
    // Add a new MyData item to the collection. TabView automatically generates a TabViewItem.
    myDatas.Add(CreateNewMyData(myDatas.Count));

  3. Launch the project and add a tab in the TabView page (third exemple)

Expected behavior
Old tabs are removed and the new tab appear

Version Info

NuGet package version:
[Microsoft.UI.Xaml.2.5.0-prerelease.200708003]

It was working on [Microsoft.UI.Xaml.2.4.2]

Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041) Yes
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Aug 12, 2020
@Felix-Dev
Copy link
Contributor

Felix-Dev commented Aug 12, 2020

I would like to take a look at this if nobody else is already looking into it.

As noticed by @Psykobal this is a regression which slipped into the WinUI 2.5 preview versions due to #2752.

@DHowett
Copy link
Member

DHowett commented Sep 5, 2020

I believe Terminal is running into this reliably on startup now that it has moved to the latest prerelease.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TabView team-Controls Issue for the Controls team
Projects
None yet
6 participants