Skip to content

XamlC resolves x:DataType incorrectly #11956

@mattleibow

Description

@mattleibow

Description

This is partly a collection of issues and partly a more specific issue. Not sure if this is 100% a bug in all cases either.

XamlC uses the x:DataType="<type-name>" on <DataTemplate> to generate type-specific bindings, however, somce times the scope is incorrect or if the XAML is wrong but happens to match there is no exception and just fails silently.

In debug you can also get these errors using <_MauiForceXamlCForDebug>true</_MauiForceXamlCForDebug> but still no warnings or exceptions anywhere.

Steps to Reproduce

  1. Clone https://github.com/mattleibow/maui-bug-repros/tree/repro-xamlc-datatype
  2. Run
  3. Observe that not all the collection views have items in them

Link to public reproduction project repository

https://github.com/mattleibow/maui-bug-repros/blob/repro-xamlc-datatype/MauiApp1/MainPage.xaml

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS, Other (Tizen, Linux, etc. not supported by Microsoft directly)

Affected platform versions

All versions

Did you find any workaround?

Make sure the x:DataType is specified correctly, and on every level of templates.

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions