Skip to content
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

feat: x:Shared #16644

Merged
merged 5 commits into from
Aug 16, 2024
Merged

feat: x:Shared #16644

merged 5 commits into from
Aug 16, 2024

Conversation

workgroupengineering
Copy link
Contributor

What does the pull request do?

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #15518

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051129-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6
Copy link
Member

I will take a better look next week. @MrJul might be also interested in reviewing it.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051143-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation can be simplified by removing duplicate code, reusing existing types, and having only the dictionary know whether an item is shared or not.

@MrJul
Copy link
Member

MrJul commented Aug 11, 2024

Just a though for discussion:

While the feature is useful, needed, and matches WPF, Avalonia usually uses explicit factory types such as Template to represent non-shared contents.

Shouldn't we go the same way here, by specializing StaticResource to recognize template resources, instead of having x:Shared?

@BAndysc
Copy link
Contributor

BAndysc commented Aug 11, 2024

Shouldn't we go the same way here, by specializing StaticResource to recognize template resources, instead of having x:Shared?

My two cents as an user, while I agree Template is a good replacement, it would be very convenient to have x:Shared when porting WPF code.

@workgroupengineering workgroupengineering marked this pull request as draft August 12, 2024 07:53
@workgroupengineering workgroupengineering marked this pull request as ready for review August 12, 2024 10:14
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051171-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051173-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes, it's looking way better.
I've left a couple of comments for easily fixed issues. After that it should be good to go :)

@MrJul
Copy link
Member

MrJul commented Aug 16, 2024

LGTM, thanks!

@MrJul MrJul enabled auto-merge August 16, 2024 09:57
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051295-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul added this pull request to the merge queue Aug 16, 2024
Merged via the queue into AvaloniaUI:master with commit 228ecc5 Aug 16, 2024
10 checks passed
@workgroupengineering workgroupengineering deleted the feature/xShared branch August 16, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ColumnDefinitions as a StaticResource throws NullReferenceException when assigning to multiple Grids.
5 participants