Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
When you create property:
[CommunityToolkit.Maui.BindableProperty]
public partial Color NotWorkingColor { get; set; }
and then try to bind to that property with a DynamicResource:
NotWorkingColor="{x:DynamicResource DummyColor}"
an error happens when building:
0>MainPage.xaml.xsg.cs(102,114): Error CS0030 : Cannot convert type 'Microsoft.Maui.Controls.Internals.DynamicResource' to 'Microsoft.Maui.Graphics.Color'
Expected Behavior
The project builds and BindableProperty generated by the package works like manually created BindableProperty.
Steps To Reproduce
Try to build project.
Link to public reproduction project repository
https://github.com/Pastajello/CTM_BindableProperty_DynamicResource
Environment
- .NET MAUI CommunityToolkit: 14.1.1
- OS: MacOS 26.4.1.
- .NET MAUI: 10.0.70
Anything else?
AutoBindable BindingProperty generator doesnt produce this issue:
https://github.com/rrmanzano/maui-bindableproperty-generator
but produces another with SourceGen :
An error occured while parsing Xaml: The given key 'Microsoft.Maui.Controls.Xaml.ValueNode' was not present in the dictionary
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
When you create property:
and then try to bind to that property with a DynamicResource:
an error happens when building:
0>MainPage.xaml.xsg.cs(102,114): Error CS0030 : Cannot convert type 'Microsoft.Maui.Controls.Internals.DynamicResource' to 'Microsoft.Maui.Graphics.Color'
Expected Behavior
The project builds and BindableProperty generated by the package works like manually created BindableProperty.
Steps To Reproduce
Try to build project.
Link to public reproduction project repository
https://github.com/Pastajello/CTM_BindableProperty_DynamicResource
Environment
Anything else?
AutoBindable BindingProperty generator doesnt produce this issue:
https://github.com/rrmanzano/maui-bindableproperty-generator
but produces another with SourceGen :
An error occured while parsing Xaml: The given key 'Microsoft.Maui.Controls.Xaml.ValueNode' was not present in the dictionary