Through the previous introduction, we should have learned that ScatterView allows developers to conveniently implement Manipulate operations on controls. Careful friends may find that there seems to be some problems with rectangular scaling in the previous example. To facilitate the description, we compile the following code.
<Grid> <s:ScatterView> <Rectangle Fill="Blue" Width="200" Height="100"/> <Ellipse Fill="Red" Width="150" Height="80"/> </s:ScatterView></Grid>
Rectangular and elliptical shapes are added to the ScatterView, and the length and width of the two images are not limited. When scaling the image, we found that the size of the two images has not changed, but the size of the ScatterViewItem has increased. It seems that the image size is limited by the length and width parameters.
In this case, you need to use the Viewbox control. Viewbox is not a Surface 2.0 SDK control, but a WPF control. It allows the image to change with the size of ScatterViewItem. The following sample code creates two identical Rectangles and embeds only one of them into the Viewbox control. The red rectangle in the Viewbox is automatically adjusted according to the size change of ScatterViewItem. In this way, when we perform the Manipulate operation, the size of the corresponding control will also change.
<Grid> <s:ScatterView> <Rectangle Fill="Blue" Width="200" Height="100"/> <Viewbox> <Rectangle Fill="Red" Width="200" Height="100"/> </Viewbox> </s:ScatterView></Grid>