如何在Wpf中的代码隐藏中获取XamComboEditor的项目源代码权限
我正在努力解决一个问题。我有一个如何在Wpf中的代码隐藏中获取XamComboEditor的项目源代码权限,wpf,xaml,Wpf,Xaml,我正在努力解决一个问题。我有一个XamComboEditor,我想知道运行时代码中该编辑器的MVVM源属性 <ig:XamComboEditor x:Name="Country" EmptyText="Select ..." DisplayMemberPath="CountryName" SelectedValuePath="CountryCode" PreviewLostKeyboardFocus="Country_PreviewLostKeyboardFocus"
XamComboEditor
,我想知道运行时代码中该编辑器的MVVM源属性
<ig:XamComboEditor x:Name="Country" EmptyText="Select ..." DisplayMemberPath="CountryName" SelectedValuePath="CountryCode" PreviewLostKeyboardFocus="Country_PreviewLostKeyboardFocus"
ItemsSource="{Binding Path=DataCountry}" IsEnabled="{Binding IsEdit,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
Grid.Row="0" SelectedItem="{Binding SelectedCountry, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Width="200" Height="40" />
如何获取MVVM属性名该
GetBindingExpression
方法需要一个DependencyProperty
:
var be = Country.GetBindingExpression(XamComboEditor.ItemsSourceProperty);
if (be != null && be.ParentBinding != null)
...
var be = Country.GetBindingExpression(XamComboEditor.ItemsSourceProperty);
if (be != null && be.ParentBinding != null)
...