ReedCopsey / Gjallarhorn.Bindable

Unidirectional binding library built on top of Gjallarhorn for WPF and Xamarin Forms
MIT License
27 stars 10 forks source link

Internal "-Errors" and "-IsValid" properties use dashes that invalid as property path in Avalonia #29

Open FoggyFinder opened 5 years ago

FoggyFinder commented 5 years ago

Functions getErrorsPropertyName and getValidPropertyName provides PropertyName that invalid in Avalonia:

    let getErrorsPropertyName propertyName =
        propertyName + "-" + "Errors"
    let getValidPropertyName propertyName =
        propertyName + "-" + "IsValid"

#2621

So, attempt to use them on Avalonia as for WPF will fail.

Even if Avalonia allow use dashes someday (rather not, I think) it's a problem now. I see only three options yet:

  1. To document it somewhere (something like list of features that unavailable in Avalonia or other platforms)
  2. To provide other implementation for these functions for Avalonia.
  3. To change implementation of these functions the way that names have been supported on all platforms.
ReedCopsey commented 5 years ago

Might be worth bringing up on Avalonia to see if they want to allow it first.

The problem with "fixing" this on our end is there is no possible way to fix it that wouldn't potentially cause conflicts with user-defined properties, as the fix would mean not using "unrepresentable names". This is a common thing done by compilers/etc, as it allows differentiation without conflict from user code. If Avalonia would support it (which is probably more of a matter of explicitly not checking for it, would be my guess), it'd be better for everybody in the long run.

FoggyFinder commented 5 years ago

I've created issue there at first - link just below code in description. Probably I had to do it more clearly.

This issue I created in trying to find at least temporary solution until Avalonia made the final decision.