Open thexamlguy opened 3 years ago
Seems like a bug, could you share your project?
Also, keep in mind that services should be resolved and consumed before leaving ProvideValue
. The IProvideValueTarget
instance is reused, so it will contain irrelevant values otherwise.
I've chucked together a quick sample Avalonia UI app containing the relevant codes, hope it helps 👍 AvaloniaApplication1.zip
I am attempting to port over this WPF MethodBindingExtension over to Avalonia UI. The only thing that is currently blocking me is that the IProvideValueTarget TargetObject is returning itself (as in the MarkupExtension class) rather than the actual object the MarkupExtension is being used within, i.e. Button. I've compared this behaviour in WPF and I can see that the IProvideValueTarget is returning the correct TargetObject.
Avalonia UI![image](https://user-images.githubusercontent.com/14894973/92024434-1d229f00-ed56-11ea-97d8-5950a2c1f4b8.png)
WPF![image](https://user-images.githubusercontent.com/14894973/92024459-2449ad00-ed56-11ea-9cff-f00934d69d9c.png)
I can only assume that this is a bug, unless of course Avalonia is correct?