-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ColumnDefinitions as a StaticResource throws NullReferenceException when assigning to multiple Grids. #15518
Comments
Never seen this application of ColumnDefinitions, but looks handy. |
DefinitionBase holds many calculation and status of groups, especially SharedSizeGroup, i doubt if this is even possible. |
the problem is there Avalonia/src/Avalonia.Controls/Grid.cs Lines 177 to 183 in 262c1b0
exactly on line 181. StaticResource return same instance for each grid. two possible solutions could be:
Personally I prefer |
Can i work on |
Given that we already have support for resource factories for lazy resource loading, x:Shared can be implemented by calling AddNotShared (or smth) instead of AddDeferred. |
I talked to the team and we would be happy if you help us to get this implemented.
|
Describe the bug
Assigning a
ColumnDefinitions
resource in two or more Grids throws runtime error.Exception:
To Reproduce
This works:
This doesn't:
Expected behavior
A resource is expected to be applied to multiple controls.
Avalonia version
11.0.10, 11.1.0-beta-2
OS
Windows
Additional context
No response
The text was updated successfully, but these errors were encountered: