From 29ac63a65d7a34a26264d05a1539b663222b05ed Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Wed, 2 Nov 2011 14:14:56 +0000 Subject: [PATCH] PropertyGrid: added FilterWatermark property which allows you to customize the watermark of the Filter textbox. --- .../PropertyGrid/Implementation/PropertyGrid.cs | 14 ++++++++++++-- .../PropertyGrid/Themes/Generic.xaml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs index de0e3276..aebdcf93 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs @@ -8,7 +8,6 @@ using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Input; using Microsoft.Windows.Controls.PropertyGrid.Commands; -using System.Reflection; namespace Microsoft.Windows.Controls.PropertyGrid { @@ -91,6 +90,17 @@ namespace Microsoft.Windows.Controls.PropertyGrid #endregion //Filter + #region FilterWatermark + + public static readonly DependencyProperty FilterWatermarkProperty = DependencyProperty.Register("FilterWatermark", typeof(string), typeof(PropertyGrid), new UIPropertyMetadata("Search")); + public string FilterWatermark + { + get { return (string)GetValue(FilterWatermarkProperty); } + set { SetValue(FilterWatermarkProperty, value); } + } + + #endregion //FilterWatermark + #region IsCategorized public static readonly DependencyProperty IsCategorizedProperty = DependencyProperty.Register("IsCategorized", typeof(bool), typeof(PropertyGrid), new UIPropertyMetadata(true, OnIsCategorizedChanged)); @@ -403,7 +413,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid } } - descriptors = new PropertyDescriptorCollection(specificProperties.ToArray()); + descriptors = new PropertyDescriptorCollection(specificProperties.ToArray()); } foreach (PropertyDescriptor descriptor in descriptors) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml index 039baca9..b0ddf12d 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml @@ -420,7 +420,7 @@ + Watermark="{TemplateBinding FilterWatermark}">