Suppose we have WPF element, in code we add content/controls to it.
How do we get the generated content as XAML?
for example in XAML we have:
In code behind:
pLines.Points.Add(new Point(10, 140));
pLines.Points.Add(new Point(270, 140));
pLines.Points.Add(new Point(270, 220));
pLines.Points.Add(new Point(255, 220));
pLines.Points.Add(new Point(230, 175));
pLines.Points.Add(new Point(205, 220));
Now how to get the generated XAML after the code behind is executed?
You can use the
XamlWriterclass.