samedi 25 avril 2015

Applying a transform to all child elements in WPF


I am implementing behavior in my application that will resize the main content area depending on the screen size. (The content area is made up of icons and other elements that the user can place/draw)

Currently, the margin property is used to position elements using a converter that converts a Point to Thickness.

Example:

http://ift.tt/1IWL6zk

"Scaling" is what I am going for, where the child elements are "scaled", position wise, to the size of the container.

How can I apply a transform (RenderTransform or LayoutTransform) to all child elements of a grid, so that the icon positions will scale to the correct position depending on the grid size?

It should also be noted that these icons may be removed/added while the application is running.


Aucun commentaire:

Enregistrer un commentaire