Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些描述形状的迷你标记。在 XAML 中,我可以直接在 XAML 中或通过绑定或资源使用此字符串,但如何以编程方式使用此标记?问题是框架中没有几何或形状 API 似乎接受字符串。
我记得在 2008 年为同样的问题苦苦挣扎。没有什么改变吗?
哼哼。我找到了这个解决方法。
Path o = (Path)XamlReader.Load(String.Format(@"<Path xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" Data=""{0}"" />", pathData));