是否可以找到包含 DependencyObject 的程序集和文件?
我目前正在为 WPF 开发一个小型本地化框架(甚至不要考虑将我指向 locBAML...),并且想知道是否有可能找到指定 DependencyObject 的包含程序集。
例如:我在文件 Window1.xaml 中有一个 XAML 中的普通窗口定义。 该窗口包含一个 StackPanel,其中包含一个 TextBlock。
当仅引用 TextBlock 时是否可以找出哪个程序集包含 Window1.xaml 文件?
是否还可以找到 xaml 文件的文件名(在本例中为“Window1.xaml”)?
预先致谢并致以诚挚的问候, 3福克斯
I am currently working on a little localization framework for WPF (don't even think about pointing me to locBAML...) and wondered if it was possible to find out the containing assembly of a specified DependencyObject.
For example: I have a normal window definition in XAML in the file Window1.xaml. The window contains a StackPanel and inside it a TextBlock resides.
Is it possible to find out which assembly contains the Window1.xaml file when only having a reference to the TextBlock?
Is it also possible to find out the file name of the xaml file ("Window1.xaml" in this case)?
Thanks in advance and best regards,
3Fox
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这样的事情会起作用。
I think something like this would work.