diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DateTimeUpDownEditor.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DateTimeUpDownEditor.cs
new file mode 100644
index 00000000..8f8b5889
--- /dev/null
+++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DateTimeUpDownEditor.cs
@@ -0,0 +1,13 @@
+using System;
+
+namespace Microsoft.Windows.Controls.PropertyGrid.Editors
+{
+ public class DateTimeUpDownEditor : TypeEditor
+ {
+ protected override void Initialize()
+ {
+ Editor = new DateTimeUpDown();
+ ValueProperty = DateTimeUpDown.ValueProperty;
+ }
+ }
+}
diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs
index 4d647318..2f5b132f 100644
--- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs
+++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs
@@ -59,7 +59,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid
#region NameWidth
- public static readonly DependencyProperty NameColumnWidthProperty = DependencyProperty.Register("NameColumnWidth", typeof(double), typeof(PropertyGrid), new UIPropertyMetadata(120.0));
+ public static readonly DependencyProperty NameColumnWidthProperty = DependencyProperty.Register("NameColumnWidth", typeof(double), typeof(PropertyGrid), new UIPropertyMetadata(150.0));
public double NameColumnWidth
{
get { return (double)GetValue(NameColumnWidthProperty); }
@@ -287,6 +287,8 @@ namespace Microsoft.Windows.Controls.PropertyGrid
editor = new IntegerUpDownEditor();
else if (propertyItem.PropertyType == typeof(double))
editor = new NumericUpDownEditor();
+ else if (propertyItem.PropertyType == typeof(DateTime))
+ editor = new DateTimeUpDownEditor();
else if (propertyItem.PropertyType.IsEnum)
editor = new EnumComboBoxEditor();
else if (propertyItem.PropertyType == typeof(FontFamily) || propertyItem.PropertyType == typeof(FontWeight) || propertyItem.PropertyType == typeof(FontStyle) || propertyItem.PropertyType == typeof(FontStretch))
diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs
index 8b9ae824..382b10f9 100644
--- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs
+++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs
@@ -2,11 +2,18 @@
using System.Windows.Controls;
using System.ComponentModel;
using System.Windows;
+using System.Windows.Data;
namespace Microsoft.Windows.Controls.PropertyGrid
{
public class PropertyItem : Control
{
+ #region Members
+
+ private DependencyPropertyDescriptor _dpDescriptor;
+
+ #endregion //Members
+
#region Properties
#region Category
@@ -24,6 +31,21 @@ namespace Microsoft.Windows.Controls.PropertyGrid
public object Instance { get; private set; }
+ ///
+ /// Gets if the property is data bound
+ ///
+ public bool IsDataBound
+ {
+ get
+ {
+ var dependencyObject = Instance as DependencyObject;
+ if (dependencyObject != null && _dpDescriptor != null)
+ return BindingOperations.GetBindingExpressionBase(dependencyObject, _dpDescriptor.DependencyProperty) != null;
+
+ return false;
+ }
+ }
+
public bool IsReadOnly { get { return PropertyDescriptor.IsReadOnly; } }
#region IsSelected
@@ -107,6 +129,21 @@ namespace Microsoft.Windows.Controls.PropertyGrid
#endregion //Value
+ ///
+ /// Gets the value source.
+ ///
+ public BaseValueSource ValueSource
+ {
+ get
+ {
+ var dependencyObject = Instance as DependencyObject;
+ if (_dpDescriptor != null && dependencyObject != null)
+ return DependencyPropertyHelper.GetValueSource(dependencyObject, _dpDescriptor.DependencyProperty).BaseValueSource;
+
+ return BaseValueSource.Unknown;
+ }
+ }
+
#endregion //Properties
#region Constructor
@@ -123,6 +160,8 @@ namespace Microsoft.Windows.Controls.PropertyGrid
Name = PropertyDescriptor.Name;
Category = PropertyDescriptor.Category;
PropertyGrid = propertyGrid;
+
+ _dpDescriptor = DependencyPropertyDescriptor.FromProperty(property);
}
#endregion //Constructor
diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml
index c79a6591..ce62e3c5 100644
--- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml
+++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml
@@ -226,7 +226,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -235,6 +250,10 @@
+
@@ -246,8 +265,8 @@
-
-
+
+