c# - How to copycloning a Canvas? -
To avoid adding new / identical elements to project elements, I want to clone a Canvas element clone (Programmatic) in WPF (Document Settings)
). For example, I have a collection of paths in canvas element / control - and this element takes about 300 KB of project size. If I add more than one element, then the XI file is heavy.
I get information about other pages about that question, and the answer / solution - comes in that line of code:
class WpfObjectCopier {public static t Clone & lt; T & gt; (T Source) {var objXaml = XamlWriter.Save (source); Var stringReader = new string reader (objXaml); Var xmlReader = XmlReader.Create (stringReader); Var t = (T) XamlReader.Load (xmlReader); Return T; }}
Usage:
object obj = WpfObjectCopier.Clone (Delimiter);
And the problem is by choosing different / different. Margin or second condition. How can I solve this kind of problem?
Visible is easy to use element in a UN clone WPF. They extend all the a
views
class which is useful, because an example of a view
class is required. This means that any UI element can be used to paint any other UI elements as brush
Here is a simple example, Which means I'm sure you can find your answer: & lt; StackPanel Vertical Element = "Center" Horizontal Alignment = "Center" & gt; & Lt; StackPanel.Resources & gt; & Lt; Visualbrush X: key = "visualbrush" visual = "{binding, elementname = complex text}" /> & Lt; /StackPanel.Resources> & Lt; Path name = "complex text" width = "75" height = "15" data = "O God!" / & Gt; & Lt; Rectangle width = "75" height = "15" Fill = "{static resource visualbrush}" strokectivity = "0" /> & Lt; / StackPanel & gt;
Comments
Post a Comment