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

Support compiled bindings for generic ViewModels #20616

Closed
StepKie opened this issue Feb 15, 2024 · 1 comment · Fixed by #20625
Closed

Support compiled bindings for generic ViewModels #20616

StepKie opened this issue Feb 15, 2024 · 1 comment · Fixed by #20625

Comments

@StepKie
Copy link

StepKie commented Feb 15, 2024

Please support compiled bindings for ViewModels based on a generic type.

Sample:

  • classes: MyViewModel<T>, MyModel
  • in code-behind: BindingContext = new MyViewModel<MyModel>()

In Xaml, I want to bind

x:DataType="viewmodels:MyViewModel(models:MyModel)"

Originally posted by @StephaneDelcroix in #20568 (comment)

@StephaneDelcroix, according to your offer, should I create an issue for this now, and tag-mention you? Just want to make sure before doing so that this is a real issue and I am not doing something obvious wrong with x:DataType="viewmodels:BoViewModel(models:BoArticle)"

@Hottemax please do

There was a similar request in the Xamarin.Forms github: xamarin/Xamarin.Forms#7161

@StephaneDelcroix StephaneDelcroix self-assigned this Feb 15, 2024
@StephaneDelcroix
Copy link
Contributor

we would need to support this syntax for x:Type as well.

currently, we're using the type as a string, but we should use the TypeArgumentsParser we already use elsewhere

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants