[BindableProperty] source generators to support partial properties #2687
stephenquan
started this conversation in
New Feature Discussions
Replies: 2 comments
-
Love this! |
Beta Was this translation helpful? Give feedback.
0 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Split from #458 and related to CommunityToolkit.Mvvm 8.4.0 partial property support https://devblogs.microsoft.com/dotnet/announcing-the-dotnet-community-toolkit-840/#partial-properties-support-for-the-mvvm-toolkit-🎉
I've been investigating applying partial property support to BindableProperty and have come up with the following pattern:
The advantages of the partial property syntax are:
Note
In order to use support for partial properties, C# preview is required. You can enable this by adding
<LangVersion>preview</LangVersion>
to your.csproj
file, or to any imported .props file (eg.Directory.Build.props
). This is necessary because the generated code makes use of thefield
keyword.I have a working implementation on:
Beta Was this translation helpful? Give feedback.
All reactions