0

Does WPF provide a control that automatically transforms contained content to be visible?

I can compute things manually, but I'd rather work with existing Dependency Properties.

I'd like to add content to this hypothetical control, rotate the content, and have the parent perform additional transformation to make sure the entire content is visible.

(Similar to Smallest possible bounding box for a rotated image)

Community
  • 1
  • 1
Cat Zimmermann
  • 1,422
  • 2
  • 21
  • 38
  • What kind of additional transformation do you expect the parent to do? There are options like ViewBox behavior, scrolling, etc. If you build up your control in terms of existing controls then calling EnsureVisible() on the child should do the right thing. – Joe Castro Jul 09 '12 at 19:44
  • 1
    What you describe is typically done by a [LayoutTransform](http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.layouttransform.aspx), which could be used instead of a [RenderTransform](http://msdn.microsoft.com/en-us/library/system.windows.uielement.rendertransform.aspx). – Clemens Jul 09 '12 at 19:57
  • This parent control has a fixed size. When I add content to it, the content may require a scale to be completely enclosed by the parent. I can do the math, but I don't want to unless I must. – Cat Zimmermann Jul 09 '12 at 20:42

1 Answers1

1

Put the whole content into a Viewbox.

Clemens
  • 123,504
  • 12
  • 155
  • 268