microsoft / microsoft/microsoft-ui-xaml
Content of TabViewItem does not change after setting its Content property
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
```cpp
const TabViewItem item;
item.Header(box_value(L"New Tab"));
tabView().TabItems().Append(item);
tabView().SelectedItem(item);
const NewTab page;
page.Position(item, self.get());
item.Content(page);
```
In the code above, the Content property is set after adding `item` to `tabView().TabItems()`. However, this resulted in the content not being visible. Reordering the operations—setting `Content` before adding the item—resolved the issue.
Is this the expected behavior, or could it be a bug?
### Steps to reproduce the bug
Obvious
### Expected behavior
_No response_
### Screenshots
_No response_
### NuGet package version
Windows App SDK 1.8 Experimental 4: 1.8.250702007-experimental4
### Packaging type
Packaged (MSIX)
### Windows version
Windows 11 version 24H2 (26100, June 2025 Update)
### IDE
Visual Studio 2022
### Additional context
_No response_
Contributor guide
Research direction
No source file or test is named. Start by reproducing the issue with the provided C++ TabViewItem sequence, then inspect the TabViewItem Content behavior and existing tests; done means determining whether setting Content after insertion is supported and correcting the behavior if it is a bug.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100