Skip to content

[BUG] AppThemeObject<T>.GetBinding calls inaccessible method #3092

@breyed

Description

@breyed

Is there an existing issue for this?

  • I have searched the existing issues

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

Current Behavior

AppThemeObject<T>.GetBinding throws an exception when called by CommunityToolkit 14.0.0 with Microsoft.Maui.Controls 10.0.40.

 Method Microsoft.Maui.Controls.AppThemeBinding..ctor()' is inaccessible from method CommunityToolkit.Maui.AppThemeObject`1[Microsoft.Maui.Graphics.Color].GetBinding()'
   at CommunityToolkit.Maui.AppThemeObject`1[[Microsoft.Maui.Graphics.Color, Microsoft.Maui.Graphics, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null]].GetBinding()

Expected Behavior

No exception. Works the same as with Microsoft.Maui.Controls 10.0.31.

Steps To Reproduce

new AppThemeColor { Light = new Color(0, 0, 0, 1), Dark = new Color(1, 1, 1, 1) }.GetBinding()

Link to public reproduction project repository

https://github.com/breyed/maui-set-binding

Environment

- .NET MAUI CommunityToolkit: 14.0.0
- OS: macOS 26.3 (tested on Android)
- .NET MAUI: 10.0.40

Anything else?

Related: #3089, dotnet/maui#33442

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions