Alex141 / CalcBinding

Advanced WPF Binding which supports expressions in Path property and other features
Apache License 2.0
632 stars 79 forks source link

porting to UWP - a nogo for me #60

Open jtorjo opened 5 years ago

jtorjo commented 5 years ago

Hi Alex,

Once again, I insanely love your lib! I wanted to start working on porting this to UWP, but I hit quite a few blockers.

For once, the idiots at UWP, don't have a "Visibility.Hidden" enum. Then, there's no Binding.Default. Those are the minor issues.

The big issues are : there's no IMultiValueConverter, and MarkupExtension is not implemented the same: You're expecting public override object ProvideValue(IServiceProvider serviceProvider) but you get public override object ProvideValue()

I didn't manage to figure out how to get a serviceProvider, and wasn't exactly sure what it was for, and long story short, there way too many issues.

I still hate UWP with all my heart, but unfortunately I need it , because of win2d.

So, I came up with a workaround, which is decent for me:

    public bool is_sel_hov => expression_value(is_selected || is_hovering, "is_selected || is_hovering", PropertyChanged);
    public string full_name => expression_value(user_name + " " + password, "user_name password", PropertyChanged);

Both is_sel_hov and full_name automatically trigger notification updates when is_selected/is_hoverint/user_name/password change.

It's not ideal, but for now it's enough for me.

Best, John