问题描述
亲爱的朋友,
我有一个接口类型为ISaveable的用户定义控件(我的用户定义接口),如下所示,
我在主窗体上有一个按钮,如果控件为Isavable,则会启用该按钮.
在下面的代码中可能会使我更有意义.
Dear Friends,
I am having a user defined control of interface type ISaveable (my user defined interface) as follows,
I have a button on the main form that is enabled if the control is Isavable.
May be I can make more sense in following code.
<Button Name="btnSave" Content="Save" IsEnabled="{Binding ElementName=expMaster, Path= (expMaster.GetType()==typeof(ISavable)) }" />
其中expMaster是实例化为的用户定义控件,
where expMaster is a user defined control instantiated as,
<Employee:EmployeeMaster x:Name="expMaster" />
从接口ISavable继承Employee master的地方.
请让我知道如何将按钮的isEnabled属性绑定到用户定义的对象类型
我不想在用户定义的控件EmployeeMaster中创建issavable属性.
最好的问候
where Employee master is inherited from interface ISavable.
please let me know how can I bind the isEnabled property of my button to the user defined object type
I don''t want to create issavable property in my user defined control EmployeeMaster.
Best regards
推荐答案
这篇关于如何将一个控件的属性绑定到另一个控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!