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

Allow generic and nested types in x:DataType and x:Type #26835

Open
BaY1251 opened this issue Dec 27, 2024 · 1 comment
Open

Allow generic and nested types in x:DataType and x:Type #26835

BaY1251 opened this issue Dec 27, 2024 · 1 comment

Comments

@BaY1251
Copy link
Contributor

BaY1251 commented Dec 27, 2024

Support compiled bindings for ViewModels based on a generic + nested type.

Sample:
classes:

public class MyViewModel<T>
{
    public class Nested
    {
        Nested() { }
    }
}

in code-behind:
BindingContext = new MyViewModel<MyModel>.Nested()
In Xaml, I want to bind
x:DataType="{x:Type viewmodels:MyViewModel(models:MyModel)+Nested"
See also #16841 #20625 #20616

@bmacombe
Copy link
Contributor

Hey @BaY1251 I too had trouble finding the correct syntax for referencing a nested type. Here is an example.

x:DataType="testSubmission:TestSubmissionsViewModel+SubmissionDisplay"

@BaY1251 BaY1251 changed the title Allow nested types in x:DataType and x:Type Allow generic and nested types in x:DataType and x:Type Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants