CommunityToolkit / CommunityToolkit/Maui

[BUG] x:TypeArguments with nullable object and StaticResources dont compile

Open
#2,752 0 comments 1 reaction 0 assignees View on GitHub
bug unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Did you read the "Reporting a bug" section on Contributing file?

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

When defining a XAML object with x:TypeArguments and a nullable object, if there is a StaticResource in that definition, the compilation indicates that the class doesn't exist. If the properties that have StaticResources are removed, then it compiles correctly, forcing those properties to be set in the class's constructor.

For example (This works):
```

...
```
For example (This DON'T work):
```
(with the same class in XAML)

If put some StaticResource in any property the compilation fail.

### Link to public reproduction project repository

https://github.com/goyometeojorito/MauiGenericPopupError/blob/master/GenericPopup.xaml

### Environment

```markdown
- .NET MAUI CommunityToolkit: 12.0.0
- OS: Android 14
- .NET MAUI: 9.0.80
```

### Anything else?

_No response_

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.