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
[X] do not apply Bindings if DataType doesnt match #22056
base: main
Are you sure you want to change the base?
Conversation
cdef2e5
to
f0d623a
Compare
var bindingContext = src ?? Context ?? context; | ||
if (DataType != null && bindingContext != null && !DataType.IsAssignableFrom(bindingContext.GetType())) | ||
{ | ||
bindingContext = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log a warning to make it easier to debug the type mismatch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid that a warning will make HotReload fail
if (node is IElementNode elementNode) | ||
Add(typeof(IXamlDataTypeProvider), new XamlDataTypeProvider(elementNode)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this service be added even when XamlC creates the new XamlServiceProvider instance? And if it is, won't this be added for almost any extension, even if IXamlDataTypeProvider
is not in its [RequiredService([...])]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
going to fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequiredService isn't in main yet. also, this won't get invoked from compiled XAML
Make sure the behavior of bindings is consistent accross implementations (compiled/not compiled) fixes a bunch of issues
f0d623a
to
18a2881
Compare
Description of Change
Make sure the behavior of bindings is consistent accross implementations (compiled/not compiled)
fixes a bunch of issues
Issues Fixed