In .NET 10 running a MAUI WinUI app the ContentPresenter does not render any content.
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
### Description
In my MAUI app i use ControlTemplates as the base for the views which have ContentPresenter controls to show the main content of the view. The Android and iOS version work without any issues, however, the WinUI shows nothing in the ContentPresenter. This used to work in .NET 9 with Controls version 9.0.90.
No errors are given.
### Steps to Reproduce
1. Create a MAUI app with the following:
```
public class ViewBase : ContentPage
{
public ViewBase()
{
ControlTemplate = (ControlTemplate)Application.Current.Resources["TestTemplate"];
}
}
```
```
```
```
```
2. Run the above in WinUI and the Text is not shown
### Link to public reproduction project repository
_No response_
### Version with bug
10.0.100
### Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
### Last version that worked well
9.0.90 SR9
### Affected platforms
Windows
### Affected platform versions
Windows SDK 10.0.19041.0
### Did you find any workaround?
Using ContentView instead of ContentPresenter
### Relevant log output
```shell
```
Contributor guide
Research direction
Start by running the provided ViewBase, ControlTemplate, ContentPresenter, and Label reproduction in a .NET 10 MAUI WinUI app, then compare it with the ContentView workaround and the previously working .NET 9 behavior. Done means the Label content renders inside the ControlTemplate's ContentPresenter on Windows without breaking the Android or iOS behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100