通过Property Value Inheritance从子类读取父类属性。 [英] Read parent class property from child class through Property Value Inheritance.

查看:153
本文介绍了通过Property Value Inheritance从子类读取父类属性。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  我的屏幕上有5个组框,每个组框有10个用户控件。我需要的是,我将在我的组框中设置一个属性,需要从我的用户控件访问。如何通过Property Value Inheritance实现这一目标。
请提供建议。

   I have some 5 group box in my screen and each group box has some 10 user controls. What I need is, I will set a property in my group box and that needs to be accessed from my user controls. how this can be achieved through Property Value Inheritance. Kindly advice.

Sanjay。

推荐答案

您还没有真正解释过您的目的。

You haven't really explained your purpose here.

您想要在UserControl中访问组框中的哪些属性?

What property in group box do you want to access in UserControl ?

>>我将在我的组框中设置一个属性,需要从我的用户控件中进行访问。

>>I will set a property in my group box and that needs to be accessed from my user controls.

您可以使用元素绑定将元素绑定到特定对象。

You can use Element Binding to bind elements to a specific object .

 <YourUserControl YourUserControlProperty="{Binding ElementName=YourGroupBox,Path=YourGroupBoxProperty}"/>

>>这是怎么回事可以通过Property Value Inheritance实现。

>>how this can be achieved through Property Value Inheritance.

你的类如何继承?

How does your class inheritance?

您的UserControl继承自UserControl, 
您的群组框是从哪个继承的?

Your UserControl is inherited from UserControl ,  What is your group box inherited from?

最好的问候,

Bob


这篇关于通过Property Value Inheritance从子类读取父类属性。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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