显示ListView中所有WPF控件的Xaml源 [英] Display Xaml source of all WPF controls in ListView

查看:111
本文介绍了显示ListView中所有WPF控件的Xaml源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取所有WPF控件的xaml源代码。

我想了解如何循环从Control类开始并遍历所有控件并读取所有控件的xaml。我的屏幕设计是在左侧我有所有控件的列表,在右侧我从左侧显示所选控件的xaml。我无法从msdn网站硬编码xaml。必须有方法通过代码动态读取和显示所有控件的xaml

I am trying to get the xaml source of all WPF controls.
I want to understand how can I loop through starting from the Control class and iterating through all the controls and read the xaml of all the controls. My screen design is that on left side I have list of all the controls and on the right side I display the xaml of the selected control from the left side. I cannot hardcode the xaml from msdn website. There must be way to read and display xaml of all the controls dynamically via code

推荐答案

WPF有一个特殊的结构,名为:LogicalTreeHelper。



http://msdn.microsoft.com/ en-us / library / system.windows.logicaltreehelper.aspx [ ^ ]
WPF has a special structure for that called: LogicalTreeHelper.

http://msdn.microsoft.com/en-us/library/system.windows.logicaltreehelper.aspx[^]


这篇关于显示ListView中所有WPF控件的Xaml源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆