I have a button that I want to bind the scaleX and scaleY to the scaleX and scaleY of another element, how can I do that?
The tricky part is that I want to bind it to an element that, at least on initialisation, may not have a ScaleTransform set on it…
Ideally, set it up so that the bindee element does always have a ScaleTransform, but it’s the identity transform. Then name that ScaleTransform, and bind to it using the usual element-to-element syntax:
If you need to bind to the element specifically, you can traverse down through the properties e.g.
{Binding LayoutTransform.ScaleX, ElementName=someElement}. This will no-op if the source element has no LayoutTransform or it isn’t a ScaleTransform, but it will report runtime binding errors.