How can I get the transformed values of a UIElement
without adding it to the visual tree in .net 3.5 in WPF?
Achievement: A UIElement
(Canvas) contains a transformation matrix and several Paths (Shapes) as content. How can I get the transformed paths (matrix transformations like scale, rotation, ... already calculated)?
Assume we're having the following Path
<Path Stroke="Black" StrokeThickness="3.0">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="355,-110">
<LineSegment Point="0,-110" />
</PathFigure>
<PathFigure StartPoint="310,-125">
<LineSegment Point="355,-110" />
<LineSegment Point="310,-95" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
... how can we get the transformed result attached to a Canvas, e.g. if the Path is scaled by a value of 2 in x and y axis?
Expected result for the example:
<Path Stroke="Black" StrokeThickness="3.0">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="700,-220">
<LineSegment Point="0,-220" />
</PathFigure>
<PathFigure StartPoint="620,-250">
<LineSegment Point="710,-220" />
<LineSegment Point="620,-190" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
I want to traverse through a generated xml string after the transformation to use it in non-wpf code. How can I get the transformed paths? All the methods I tried (GetChild etc.) delivered the original paths without transformation.