You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In certain scenarios, XamlC should be able to infer the x:DataType based on the value passed to BindingContext on any XAML element or to Source on BindingExtension elements:
{StaticResource X} - in the case when X is defined in the same XAML document
{x:Static Y}
{x:Reference Z}
{Binding W} - when the binding is compiled
{Binding Source={RelativeSource U}}:
Self - when the elemet to which the binding is set is statically known
FindAncestor
FindAncestorBindingContext - when the ancestor and the type of the binding context can be statically resolved
TemplatedParent - when the templated parent can be statically resolved
Explicitly declared x:DataType should always take precedence over the inferred type. In the case when there is a mismatch, we should consider emitting a warning.
In certain scenarios, XamlC should be able to infer the
x:DataType
based on the value passed toBindingContext
on any XAML element or toSource
onBindingExtension
elements:{StaticResource X}
- in the case whenX
is defined in the same XAML document{x:Static Y}
{x:Reference Z}
{Binding W}
- when the binding is compiled{Binding Source={RelativeSource U}}
:Self
- when the elemet to which the binding is set is statically knownFindAncestor
FindAncestorBindingContext
- when the ancestor and the type of the binding context can be statically resolvedTemplatedParent
- when the templated parent can be statically resolvedExplicitly declared
x:DataType
should always take precedence over the inferred type. In the case when there is a mismatch, we should consider emitting a warning.Are there any other cases which we could infer?
/cc @StephaneDelcroix
The text was updated successfully, but these errors were encountered: