microsoft / XamlBehaviors

This is the official home for UWP XAML Behaviors on GitHub.
MIT License
701 stars 112 forks source link

Support CallMethodAction with Custom Parameter #214

Open michael-hawker opened 3 years ago

michael-hawker commented 3 years ago

It'd be nice for CallMethodAction to support an additional property for MethodParameter in order to allow overwriting the incoming parameter from the parent behavior to something specified by the developer in XAML:

  <b:CallMethodAction TargetObject="{x:Bind ContextFlyout}" MethodName="ShowAt" MethodParameter="{x:Bind FooElement}"/>

This would provide a little bit more flexibility.

pedrolamas commented 3 years ago

I can see the usefulness in what you ask... quite honestly, the whole code on the XamlBehaviors are still legacy from a time where we only had legacy Bindings (instead of compiled ones) and had to resort a lot to reflection, but nowadays that is not the case anymore... makes me wonder if a deeper rethink of this whole thing should be done for WinUI 3 support!