Skip to content
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

[DO-NOT-MERGE] Compiled PropertyPath for setters #2659

Closed
wants to merge 5 commits into from

Conversation

kekekeks
Copy link
Member

@kekekeks kekekeks commented Jun 14, 2019

Currently intended for use in animations.
@jmacato

For now they are quite simple, but already support syntax like
(Visual.RenderTransform):=ScaleTransform.ScaleX
MyProperty :> MyModelType .Foo.Bar
MyProperty as MyModelType .Foo.Bar
Where :> and as are cast operators, and := is type ensuring operator
Type ensuring is needed for animations to be able to switch a property value type somewhere along the path
E. g. if RenderTransform isn't a ScaleTransform, set RenderTransform to a fresh instance of ScaleTransform
Casts are needed for bindings to ensure that property has a correct type to continue.

IPropertyInfo and ClrPropertyInfo provide reflection-free access to regular CLR properties. This is backed by compile time property accessor generation. ReflectionClrPropertyInfo uses provides same interface via reflection and is not used by compiler.

I've also made AvaloniaProperty to implement IPropertyInfo for convenience purposes

@kekekeks kekekeks changed the title [WIP] Compiled PropertyPath for setters [DO-NOT-MERGE] Compiled PropertyPath for setters Jun 14, 2019
@jkoritzinsky
Copy link
Collaborator

What's the purpose of the ChildTraversal element in the property paths? Since it can only legally be followed by a Property element and has no state, it should not be represented in the PropertyPath element list and the . that it represents should be handled exclusively by the parser. That way, there's less possibilities for an invalid PropertyPath and a cleaner API for manipulating them.

@kekekeks
Copy link
Member Author

We can remove the child traversal element. I was thinking that it might be useful for type enforcement operator := to keep track of the traversal point, but it's not really required.

@danwalmsley
Copy link
Member

closing due to inactivity.

@danwalmsley danwalmsley closed this Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants