How can I resolve 'member not found in data context 'foo' XAML intellisense warnings? #25536
Unanswered
DanTravison
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have several DataTemplate declarations with an x:DataType that reference an interface and the interface itself derives from base interface.
When I declare a binding to a property on the base interface, the XAML editor places 4 dots under the property name and the tooltip indicates "Member not found in data context 'derived interface'".
I know from usage that the binding is being generated so I assume this means that compiled bindings are not being generated.
Reading page discussing compiled bindings indicates the x:Type markup extension can also be used so I've tried changing the bindings to use x:DataType="{x:Type derivedinterface}" but see no change.
Am I using the extension correctly or am I missing something? My goal is to ensure compiled bindings are being used.
As an aside: I've also added MauiStrictXamlCompilation to the containing csproj file, rebuilt the project, and don't see any warnings.
I'm using Maui version 8.0.80.
In the below example, IsVisible is defined on IPopupItem and IsEnabled is defined on the base interface. I also see this with similar usage. The two IsEnabled bindings both have the warnings.
I know the binding is working because I have Triggers defined in the associated Styles for IsEnabled.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions