快速提问,如何将其转换为后端代码?即c#
ItemsSource =“{Binding Source = {StaticResource List1},XPath = Entry}”
答案 0 :(得分:5)
Binding items = new Binding();
items.Source = FindResource("List1");
items.XPath = "Entry";
myItemsControl.SetBinding(ItemsControl.ItemsSourceProperty, items);
myItemsControl
是设置ItemsSource
的控件。