Given the following canvas:
<Canvas> <Canvas.LayoutTransform> <ScaleTransform ScaleX='1' ScaleY='1' CenterX='.5' CenterY='.5' /> </Canvas.LayoutTransform> <Button x:Name='scaleButton' Content='Scale Me' Canvas.Top='10' Canvas.Left='10' /> <Button x:Name='dontScaleButton' Content='DON'T Scale Me' Canvas.Top='10' Canvas.Left='50' /> </Canvas>
Is it possible to scale 1 button, but not the other when ScaleX and ScaleY changes?
Not in XAML. You can do this in code by building the reverse transform and applying it to the object you don’t want transformed.
If you want to go fancy, you can build a dependency property that you can attach in XAML to any object you don’t want to be transformed by any parent transforms. This dependency property will take the transform of the parent, build a reverse transform and apply it to the object it’s attached to.