Closed MartinStrbak closed 1 year ago
@MartinStrbak do you know if this issue is unique to winui3 or if it is present in winui2 as well?
@StephenLPeters I tried in only on Win32 windows app type for WinUI (therefore WinUI3 only), as I am not familiar with UWP development.
I tried to replicate it on UWP with this result (see attached projects):
Hope this helps. Sample-UWP.zip
For UWP with WinUI2, the preview build that is referenced in #3969 fixes this faulty behavior for me.
@MartinStrbak Can you see if this also repos with the latest WinUI 2 prerelease?
@StephenLPeters If this doesn't repo with latest prerelease, could this be closed than since the changes would only have to be backported to the next WinUI 3 release?
Is TabView.SelectedItem
property expected to change upon a new tab is being added ? I do not see this happening.
@StephenLPeters I tried in only on Win32 windows app type for WinUI (therefore WinUI3 only), as I am not familiar with UWP development.
I tried to replicate it on UWP with this result (see attached projects):
- UWP + WinUI2 (Nuget package Microsoft.UI.Xaml 2.5.0) - same result as in Win32 + WinUI3 (SelectedItem change does not work after adding new item)
- UWP + WinUI3 - same behavior as in Win32+WinUI3 (SelectedItem change does not work), but one additional issue occured - after adding new item to TabItemsSource collection, new tab is not displayed at all in TabView.
Hope this helps. Sample-UWP.zip
Yes, I too am having this same issue with UWP + WinUI 3. The New Tab is not at all displaying when a new item is added to the TabItemsSource ObservableCollection. But, it does get added to the collection. The Only problem is that it does not reflect the New Tab in the UI. Suppose, if Data Binding is not used and TabItems are added Manually, it is working perfectly. But, I want to use Data Binding. If anyone has a workaround for this problem, kindly share it.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Still not working.
So do issues just get closed if Microsoft ignores them long enough? This framework is a nightmare.
Opt for selectedindex and hack in the prop setter as a workaround...
Yeah thanks. That's really not the point though.
Describe the bug When item is added to TabItemsSource collection and SelectedItem is changed to this newly added item, TabView UI does not reflect this (corresponding TabViewItem remains unselected).
Steps to reproduce the bug
Run attached project Sample project.zip
Clicking on first button works correctly - last tab is highlighted in UI if collection is unchanged
SelectedItem = Items[Items.Count - 1];
Clicking on second button does not work - selected item is not highlighted when I add item to collection right before setting SelectedItem
Items.Add("New item");
SelectedItem = Items[Items.Count - 1];
Expected behavior TabViewItem corresponding to SelectedItem is selected (highlighted) in TabView UI.
Version Info NuGet package version: [Microsoft.WinUI 3.0.0-preview3.201113.0]