本文介绍了等效于XAML代码的C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<dxe:TextEdit Name="txtCompanyName" my:FilterGrid.Obj ="{Binding ElementName=dXCustomers}"
my:FilterGrid.ConditionValue="{Binding RelativeSource={RelativeSource Self}, Path=Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
my:FilterGrid.ColumnName="CompanyName"
my:FilterGrid.Operator="Like" />
推荐答案
TextEdit textedit = ...;
Binding binding = new Binding();
binding.ElementName = "dXCustomers";
textedit.SetBinding([somedependencyproperty], binding);
binding = new Binding("Text");
binding.RelativeSource = new RelativeSource(RelativeSourceMode.Self);
binding.Mode = BindingMode.TwoWay;
binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
textedit.SetBinding([somedependencyproperty], binding);
这篇关于等效于XAML代码的C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!