From 7e8fd94c47e5cd739df80714d21595379947f69f Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Sun, 31 Jul 2011 03:16:25 +0000 Subject: [PATCH] PropertyGrid: added Update() method which will allow you to update all property values in the PropertyGrid with the data from the SelectedObject. This is helpful when your SelectedObject does not implement the INotifyPropertyChanged interface. --- .../PropertyGrid/Implementation/PropertyGrid.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs index dafa69a2..ed7edda7 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs @@ -489,6 +489,17 @@ namespace Microsoft.Windows.Controls.PropertyGrid Properties = null; } + /// + /// Updates all property values in the PropertyGrid with the data from the SelectedObject + /// + public void Update() + { + foreach (var item in Properties) + { + BindingOperations.GetBindingExpressionBase(item, PropertyItem.ValueProperty).UpdateTarget(); + } + } + #endregion //Methods } }