-
Notifications
You must be signed in to change notification settings - Fork 35
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
[Proposal] Typed Bindings #155
Comments
@brminnick instead of having |
Good Question! I made Since Each Mode = (setter, mode) switch
{
(_, not null) => mode.Value, // Always use the provided mode when given
(null, null) => BindingMode.OneWay, // When setter is null, binding is read-only; use BindingMode.OneWay to improve performance
_ => BindingMode.Default // Default to BindingMode.Default
}, ^ If the user doesn't provide a setter and doesn't provide a BindingMode, then we can safely assume the binding is read-only and set the BindingMode to If the user does provide a setter, and doesn't provide a
We can't make the default |
Approved in December Standup: https://www.youtube.com/watch?v=tqQhW104UKI |
Reopening Proposal. Only Proposals moved to the |
Have tried this thing previously, as a replacement to bind a nested property without using the Can this be extended to the And support for default |
Yes! I believe @bijington is working on a Proposal for
Maybe. To be honest, I think default bindable properties were a mistake and shouldn’t have been included in |
Great to hear that
It does make it easy to create Bindings in the long run once the developer is familiar with the nature of the control. When is the documentation planned to get updated on the official site here? |
Oh I forgot to add in the proposal for the I personally prefer the explicitness of defining the property being bound rather than the defaults but I don't feel too strongly about it.
We believe we have updated all the relevant examples to use the new typed bindings. Once the next proposals are completed then we can update the rest of the docs. Unless you think we have missed some? |
Feature name
Typed Bindings
Link to discussion
#154 (reply in thread)
Progress tracker
Summary
Typed Bindings are used by XAML Compiled Bindings to improve performance and ensure Type safety.
This Proposal extends the
.Bind()
extension method by providing the option of usingTypedBinding
which is the binding engine used by XAML Compiled Bindings to improve performance and ensure Type safety.Motivation
The current implementation of
.Bind()
uses theBinding
class which requires reflection when a change to the binding is applied.This updated implementation brings the option of using
TypedBinding
with the.Bind()
extension method which does not require reflection providing a substantial performance improvement for bindings.Detailed Design
A POC of this can be found on the
Compiled-Bindings
branch:Usage Syntax
Drawbacks
This is an overload to the existing
.Bind()
method, increasing the number of overloaded methods for.Bind()
to 16.This implementation also ignores
TypedBinding
'sstring[] handler
constructor parameter. This parameter isn't documented and I'm unsure how it is being used and what use-cases it covers. However, I'm confident we can add support for this parameter in a future update without breaking changes.Alternatives
TypedBinding
can be used currently without C# Markup ExtensionsUnresolved Questions
Should we use a different name for this extension method, like
.TypedBind()
?The text was updated successfully, but these errors were encountered: