Tag: wpf extended toolkit

WPF PropertyGrid支持多种选择

这个文档是否仍然有效或者我遗漏了什么? http://doc.xceedsoft.com/products/XceedWpfToolkit/Xceed.Wpf.Toolkit~Xceed.Wpf.Toolkit.PropertyGrid.PropertyGrid~SelectedObjects.html PropertyGrid控件似乎没有SelectedObjects或SelectedObjectsOverride成员。 我正在使用针对.NET Framework 4.0的Toolkit的最新版本(2.5)。 UPDATE @ faztp12的回答让我了解了。 对于寻找解决方案的其他人,请按照下列步骤操作: 将PropertyGrid的SelectedObject属性绑定到第一个选定的项目。 像这样的东西: 侦听PropertyValueChanged事件,并使用以下代码将属性值更新为所有选定对象。 private void PG_PropertyValueChanged(object sender, PropertyGrid.PropertyValueChangedEventArgs e) { var changedProperty = (PropertyItem)e.OriginalSource; foreach (var x in SelectedObjects) { //make sure that x supports this property var ProperProperty = x.GetType().GetProperty(changedProperty.PropertyDescriptor.Name); if (ProperProperty != null) { //fetch property descriptor from the actual declaring type, otherwise […]