Grouping multiple transforms
It is not mandatory to have a single transform to a single element. You can group multiple transforms to it, by using the <TransformGroup></TransformGroup>
tag. In this recipe, we will learn how to group multiple transforms.
Getting ready
To get started, open Visual Studio and create a new project named CH08.GroupedTransformsDemo
based on the WPF application template.
How to do it...
Let's follow these steps to add two images to the application window and flip the second image to give a reflection effect. This will be done by grouping multiple transforms to that image:
- First, we need to add an image to the project. To do this, create a folder named
Images
in the project root directory. - Right-click on the
Images
folder and add an existing image to it. Name itimage1.png
, which will be accessible from XAML asImages/image1.png
. - From the
Solution Explorer
, navigate to theMainWindow.xaml
file. - Replace the existing
Grid
panel with a horizontalStackPanel
. - Insert...