如果你是想显示代码,而不是呈现xaml代码对应的控件,那就用TextBlock 2.如果想动态呈现控件,参考XamlReader http://technet.microsoft.com/zh-cn/system.windows.markup.xamlreader(de-de).aspx
<ContextMenu><ContextMenu.Items>
<ListBox>
<ListBoxItem Content="fsdfsdf"/>
<ListBoxItem Content="111111111111"/>
</ListBox>
<TextBlock Text="fdsfsdf"/>
<TextBlock Text="fsdfsddddddddddddddddddddddd"/>
</ContextMenu.Items>
</ContextMenu>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)