在WPF中,如何得到任何Object对象的XAML代码?
原文: 在WPF中,如何得到任何Object对象的XAML代码? 在WPF中,可以使用System.Windows.Markup.XamlWriter.Save(objName)得到任何Object对象的XAML代码。 这里举个例子,然后来比较一下:XAML代码:// Window1.xaml<Window x:Class="XamlWriter.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="XamlWriter" Height="421" Width="485" > <Grid Name="Grid1"> <Button Height="23" Margin="9,13,0,0" Name="buttonA" VerticalAlignment="Top" Click="WriteXaml_A" HorizontalAlignme...