I’m working within the WPF stack, and I’d like to be able to get a MatrixTransform for any Transform. According to the link here, it doesn’t seem that MatrixTransform is a base class but rather a sibling to the other Transform types. However, all normal graphics transforms should boil down to a MatrixTransform. Are there any shortcuts for this? Maybe something like hidden cast operators to take any transform to a MatrixTransform?
Share
The base class of
TranslateTransform,MatrixTransform, etc. is the abstract classTransform.The
Transformclass exposes aValueproperty of typeMatrix. TheMatrixTransformclass has a constructor that takes aMatrix. So to get the generalMatrixTransformcorresponding to an existingLayoutTransformof aFrameworkElementyou can use code like this: