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

Combiners registration via Setup.FillValueCombiners() override #4615

Merged
merged 2 commits into from
May 30, 2023

Conversation

snechaev
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Feature

⤵️ What is the current behavior?

There is no easy way to register ValueCombiner. The only way is to provide a custom implementation of BindingBuilder, which seems like overkill for such a task.

🆕 What is the new behavior (if this is a feature change)?

This PR adds the FillValueCombiners(IMvxValueCombinerRegistry registry) overload to the platform-specific Setup classes (MvxIosSetup, MvxMacSetup, etc.). This behaves the same way as the void FillValueConverters(IMvxValueConverterRegistry registry) for the converters. This gives the user with exactly the same experience as the for converters (except the naming-convention-based autoregistration, which was considered problematic from a performance point of view). With this overload, the developer able to easily register the combiners, either manually one-by-one or with assembly-scan or whatever.

💥 Does this PR introduce a breaking change?

No

🐛 Recommendations for testing

Nothing special, but worth remembering that name in the registration process should be without suffixes and prefixes. For example, for the MvxMySuperValueCombiner the name MySuper should be used during registration.

📝 Links to relevant issues/docs

#4371

🤔 Checklist before submitting

@snechaev
Copy link
Contributor Author

The dotnet format check failed on files that have not changed in the current PR. I don't think that it is a good idea to fix the formatting in the files that are unrelated to the this PR and include such a changes in the PR.

@snechaev snechaev changed the title Combiners registration via Setup.FillValueConverters() override Combiners registration via Setup.FillValueCombiners() override May 29, 2023
Cheesebaron
Cheesebaron previously approved these changes May 30, 2023
@Cheesebaron
Copy link
Member

Cheesebaron commented May 30, 2023

Build is failing:

D:\a\1\s\MvvmCross\Platforms\Wpf\Core\MvxWpfSetup.cs(139,51): error CS0246: The type or namespace name 'IMvxValueCombinerRegistry' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\MvvmCross.Wpf\MvvmCross.Platforms.Wpf.csproj

Looks good to me otherwise.

@snechaev
Copy link
Contributor Author

Sorry, I did not noticed that Windows projects are not built on Mac hosts at least with the simplified build process (EnableWindowsTargeting=true). The build is now fixed. No changes other than the missing usings have been introduced.

@Cheesebaron Cheesebaron merged commit 1117d52 into MvvmCross:develop May 30, 2023
4 of 5 checks passed
@Cheesebaron
Copy link
Member

Thanks!

@snechaev snechaev deleted the combiners_registration branch June 1, 2023 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants