Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[All] Bindable span #1850
Description of Change
This allows Text to be Bindable on a Span.
jassmith left a comment
Looks pretty good, there are plenty of places where double GetValue calls occur but those were there in the past too. If you want to go the extra mile and clean those up, great, otherwise its nowhere near a blocker.
Im wondering if it might make sense to have all the bindings in here be OneTime by default. I doubt that generally speaking spans need dynamic binding and OneTime bindings are much cheaper. We have an opportunity here to make things fast by default in this area at least, even if we cant change it elsewhere.
StephaneDelcroix left a comment
It looks good, but I think that, as the Parent/Children concept is missing, you won't be able to apply css styles, dynamic resources, ...
I can look at that when I have a few minutes, but in the mean time, do not merge this PR
@StephaneDelcroix - I set the parent going down. The FormattedText was changed to inherit from Element, then parent set, and Parent set on all Spans.
@jassmith - I assume the GetValue multiple calls was the Text property is called a lot of times, I made minor changes to reduce the number of calls. Down to 1 on iOS and UWP. Down to 2 from 4 on Android.
As for OneTime bindings, I didn't know they existed. How would you implement them?
This was referenced
Feb 18, 2018
Mar 8, 2018
13 checks passed
referenced this pull request
Mar 24, 2018
Really excited about this feature. Installed 3.1.0 pre release to test this out but I keep getting the following error: System.MissingFieldException: Field 'Xamarin.Forms.Span.TextProperty' not found.
My code is as followed: