Browse Source

PropertyGrid: implemented SelectedProperty.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
68a8143c63
  1. 119
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs
  2. 107
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs
  3. 23
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml

119
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs

@ -8,6 +8,7 @@ using System.Windows.Media;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System.ComponentModel; using System.ComponentModel;
using Microsoft.Windows.Controls.PropertyGrid.Implementation.EditorProviders; using Microsoft.Windows.Controls.PropertyGrid.Implementation.EditorProviders;
using System.Windows.Input;
namespace Microsoft.Windows.Controls.PropertyGrid namespace Microsoft.Windows.Controls.PropertyGrid
{ {
@ -41,54 +42,30 @@ namespace Microsoft.Windows.Controls.PropertyGrid
protected virtual void OnIsCategorizedChanged(bool oldValue, bool newValue) protected virtual void OnIsCategorizedChanged(bool oldValue, bool newValue)
{ {
LoadProperties(newValue); LoadProperties(newValue);
} }
#endregion //IsCategorized #endregion //IsCategorized
#region NameWidth #region NameWidth
public static readonly DependencyProperty NameWidthProperty = DependencyProperty.Register("NameWidth", typeof(double), typeof(PropertyGrid), new UIPropertyMetadata(120.0, OnNameWidthChanged)); public static readonly DependencyProperty NameColumnWidthProperty = DependencyProperty.Register("NameColumnWidth", typeof(double), typeof(PropertyGrid), new UIPropertyMetadata(120.0));
public double NameWidth public double NameColumnWidth
{ {
get { return (double)GetValue(NameWidthProperty); } get { return (double)GetValue(NameColumnWidthProperty); }
set { SetValue(NameWidthProperty, value); } set { SetValue(NameColumnWidthProperty, value); }
}
private static void OnNameWidthChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
PropertyGrid propertyGrid = o as PropertyGrid;
if (propertyGrid != null)
propertyGrid.OnNameWidthChanged((double)e.OldValue, (double)e.NewValue);
}
protected virtual void OnNameWidthChanged(double oldValue, double newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
} }
#endregion //NameWidth #endregion //NameWidth
#region Properties #region Properties
public static readonly DependencyProperty PropertiesProperty = DependencyProperty.Register("Properties", typeof(PropertyCollection), typeof(PropertyGrid), new UIPropertyMetadata(null, OnPropertiesChanged)); public static readonly DependencyProperty PropertiesProperty = DependencyProperty.Register("Properties", typeof(PropertyCollection), typeof(PropertyGrid), new UIPropertyMetadata(null));
public PropertyCollection Properties public PropertyCollection Properties
{ {
get { return (PropertyCollection)GetValue(PropertiesProperty); } get { return (PropertyCollection)GetValue(PropertiesProperty); }
private set { SetValue(PropertiesProperty, value); } private set { SetValue(PropertiesProperty, value); }
} }
private static void OnPropertiesChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
PropertyGrid propertyGrid = o as PropertyGrid;
if (propertyGrid != null)
propertyGrid.OnPropertiesChanged((PropertyCollection)e.OldValue, (PropertyCollection)e.NewValue);
}
protected virtual void OnPropertiesChanged(PropertyCollection oldValue, PropertyCollection newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //Properties #endregion //Properties
#region SelectedObject #region SelectedObject
@ -127,7 +104,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid
public Type SelectedObjectType public Type SelectedObjectType
{ {
get { return (Type)GetValue(SelectedObjectTypeProperty); } get { return (Type)GetValue(SelectedObjectTypeProperty); }
set { SetValue(SelectedObjectTypeProperty, value); } private set { SetValue(SelectedObjectTypeProperty, value); }
} }
private static void OnSelectedObjectTypeChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) private static void OnSelectedObjectTypeChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
@ -146,49 +123,52 @@ namespace Microsoft.Windows.Controls.PropertyGrid
#region SelectedObjectTypeName #region SelectedObjectTypeName
public static readonly DependencyProperty SelectedObjectTypeNameProperty = DependencyProperty.Register("SelectedObjectTypeName", typeof(string), typeof(PropertyGrid), new UIPropertyMetadata(string.Empty, OnSelectedObjectTypeNameChanged)); public static readonly DependencyProperty SelectedObjectTypeNameProperty = DependencyProperty.Register("SelectedObjectTypeName", typeof(string), typeof(PropertyGrid), new UIPropertyMetadata(string.Empty));
public string SelectedObjectTypeName public string SelectedObjectTypeName
{ {
get { return (string)GetValue(SelectedObjectTypeNameProperty); } get { return (string)GetValue(SelectedObjectTypeNameProperty); }
set { SetValue(SelectedObjectTypeNameProperty, value); } private set { SetValue(SelectedObjectTypeNameProperty, value); }
}
private static void OnSelectedObjectTypeNameChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
PropertyGrid propertyGrid = o as PropertyGrid;
if (propertyGrid != null)
propertyGrid.OnSelectedObjectTypeNameChanged((string)e.OldValue, (string)e.NewValue);
}
protected virtual void OnSelectedObjectTypeNameChanged(string oldValue, string newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
} }
#endregion //SelectedObjectTypeName #endregion //SelectedObjectTypeName
#region SelectedObjectName #region SelectedObjectName
public static readonly DependencyProperty SelectedObjectNameProperty = DependencyProperty.Register("SelectedObjectName", typeof(string), typeof(PropertyGrid), new UIPropertyMetadata(string.Empty, OnSelectedObjectNameChanged)); public static readonly DependencyProperty SelectedObjectNameProperty = DependencyProperty.Register("SelectedObjectName", typeof(string), typeof(PropertyGrid), new UIPropertyMetadata(string.Empty));
public string SelectedObjectName public string SelectedObjectName
{ {
get { return (string)GetValue(SelectedObjectNameProperty); } get { return (string)GetValue(SelectedObjectNameProperty); }
set { SetValue(SelectedObjectNameProperty, value); } private set { SetValue(SelectedObjectNameProperty, value); }
}
#endregion //SelectedObjectName
#region SelectedProperty
public static readonly DependencyProperty SelectedPropertyProperty = DependencyProperty.Register("SelectedProperty", typeof(PropertyItem), typeof(PropertyGrid), new UIPropertyMetadata(null, OnSelectedPropertyChanged));
public PropertyItem SelectedProperty
{
get { return (PropertyItem)GetValue(SelectedPropertyProperty); }
internal set { SetValue(SelectedPropertyProperty, value); }
} }
private static void OnSelectedObjectNameChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) private static void OnSelectedPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{ {
PropertyGrid propertyGrid = o as PropertyGrid; PropertyGrid propertyGrid = o as PropertyGrid;
if (propertyGrid != null) if (propertyGrid != null)
propertyGrid.OnSelectedObjectNameChanged((string)e.OldValue, (string)e.NewValue); propertyGrid.OnSelectedPropertyChanged((PropertyItem)e.OldValue, (PropertyItem)e.NewValue);
} }
protected virtual void OnSelectedObjectNameChanged(string oldValue, string newValue) protected virtual void OnSelectedPropertyChanged(PropertyItem oldValue, PropertyItem newValue)
{ {
// TODO: Add your property changed side-effects. Descendants can override as well. if (oldValue != null)
} oldValue.IsSelected = false;
#endregion //SelectedObjectName if (newValue != null)
newValue.IsSelected = true;
}
#endregion //SelectedProperty
#endregion //Properties #endregion //Properties
@ -211,13 +191,23 @@ namespace Microsoft.Windows.Controls.PropertyGrid
_dragThumb.DragDelta += DragThumb_DragDelta; _dragThumb.DragDelta += DragThumb_DragDelta;
} }
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
//hitting enter on textbox will update value of underlying source
if (this.SelectedProperty != null && e.Key == Key.Enter && e.OriginalSource is TextBox)
{
BindingExpression be = ((TextBox)e.OriginalSource).GetBindingExpression(TextBox.TextProperty);
be.UpdateSource();
}
}
#endregion //Base Class Overrides #endregion //Base Class Overrides
#region Event Handlers #region Event Handlers
void DragThumb_DragDelta(object sender, DragDeltaEventArgs e) void DragThumb_DragDelta(object sender, DragDeltaEventArgs e)
{ {
NameWidth = Math.Max(0, NameWidth + e.HorizontalChange); NameColumnWidth = Math.Max(0, NameColumnWidth + e.HorizontalChange);
} }
#endregion //Event Handlers #endregion //Event Handlers
@ -232,7 +222,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid
Properties = GetAlphabetizedProperties(_propertyItemsCache); Properties = GetAlphabetizedProperties(_propertyItemsCache);
} }
private static List<PropertyItem> GetObjectProperties(object instance) private List<PropertyItem> GetObjectProperties(object instance)
{ {
var propertyItems = new List<PropertyItem>(); var propertyItems = new List<PropertyItem>();
if (instance == null) if (instance == null)
@ -243,14 +233,14 @@ namespace Microsoft.Windows.Controls.PropertyGrid
// Get all properties of the type // Get all properties of the type
propertyItems.AddRange(properties.Cast<PropertyDescriptor>(). propertyItems.AddRange(properties.Cast<PropertyDescriptor>().
Where(p => p.IsBrowsable && p.Name != "GenericParameterAttributes"). Where(p => p.IsBrowsable && p.Name != "GenericParameterAttributes").
Select(property => CreatePropertyItem(property, instance))); Select(property => CreatePropertyItem(property, instance, this)));
return propertyItems; return propertyItems;
} }
private static PropertyItem CreatePropertyItem(PropertyDescriptor property, object instance) private static PropertyItem CreatePropertyItem(PropertyDescriptor property, object instance, PropertyGrid grid)
{ {
PropertyItem propertyItem = new PropertyItem(instance, property); PropertyItem propertyItem = new PropertyItem(instance, property, grid);
ITypeEditorProvider editorProvider = null; ITypeEditorProvider editorProvider = null;
if (propertyItem.PropertyType == typeof(string)) if (propertyItem.PropertyType == typeof(string))
@ -275,20 +265,18 @@ namespace Microsoft.Windows.Controls.PropertyGrid
return propertyItem; return propertyItem;
} }
private PropertyCollection GetCategorizedProperties(List<PropertyItem> propertyItems) private static PropertyCollection GetCategorizedProperties(List<PropertyItem> propertyItems)
{ {
PropertyCollection propertyCollection = new PropertyCollection(); PropertyCollection propertyCollection = new PropertyCollection();
CollectionViewSource src = new CollectionViewSource(); CollectionViewSource src = new CollectionViewSource { Source = propertyItems };
src.Source = propertyItems;
src.GroupDescriptions.Add(new PropertyGroupDescription("Category")); src.GroupDescriptions.Add(new PropertyGroupDescription("Category"));
src.SortDescriptions.Add(new SortDescription("Category", ListSortDirection.Ascending)); src.SortDescriptions.Add(new SortDescription("Category", ListSortDirection.Ascending));
src.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); src.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
foreach (CollectionViewGroup item in src.View.Groups) foreach (CollectionViewGroup item in src.View.Groups)
{ {
PropertyCategoryItem propertyCategoryItem = new PropertyCategoryItem(); PropertyCategoryItem propertyCategoryItem = new PropertyCategoryItem { Category = item.Name.ToString() };
propertyCategoryItem.Category = item.Name.ToString();
foreach (var propertyitem in item.Items) foreach (var propertyitem in item.Items)
{ {
propertyCategoryItem.Properties.Add((PropertyItem)propertyitem); propertyCategoryItem.Properties.Add((PropertyItem)propertyitem);
@ -299,15 +287,14 @@ namespace Microsoft.Windows.Controls.PropertyGrid
return propertyCollection; return propertyCollection;
} }
private PropertyCollection GetAlphabetizedProperties(List<PropertyItem> propertyItems) private static PropertyCollection GetAlphabetizedProperties(List<PropertyItem> propertyItems)
{ {
PropertyCollection propertyCollection = new PropertyCollection(); PropertyCollection propertyCollection = new PropertyCollection();
if (propertyItems == null) if (propertyItems == null)
return propertyCollection; return propertyCollection;
CollectionViewSource src = new CollectionViewSource(); CollectionViewSource src = new CollectionViewSource { Source = propertyItems };
src.Source = propertyItems;
src.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); src.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
foreach (var item in ((ListCollectionView)(src.View))) foreach (var item in ((ListCollectionView)(src.View)))

107
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs

@ -7,104 +7,66 @@ namespace Microsoft.Windows.Controls.PropertyGrid
{ {
public class PropertyItem : Control public class PropertyItem : Control
{ {
#region Members
public object Instance { get; private set; }
public PropertyDescriptor PropertyDescriptor { get; private set; }
#endregion //Members
#region Properties #region Properties
public string Description #region Category
{
get { return PropertyDescriptor.Description; }
}
public bool IsWriteable public static readonly DependencyProperty CategoryProperty = DependencyProperty.Register("Category", typeof(string), typeof(PropertyItem), new UIPropertyMetadata(string.Empty));
public string Category
{ {
get { return !IsReadOnly; } get { return (string)GetValue(CategoryProperty); }
set { SetValue(CategoryProperty, value); }
} }
public bool IsReadOnly #endregion //Category
{
get { return PropertyDescriptor.IsReadOnly; }
}
public Type PropertyType public string Description { get { return PropertyDescriptor.Description; } }
{
get { return PropertyDescriptor.PropertyType; }
}
//public string Category public object Instance { get; private set; }
//{
// get { return PropertyDescriptor.Category; } public bool IsReadOnly { get { return PropertyDescriptor.IsReadOnly; } }
//}
public static readonly DependencyProperty CategoryProperty = DependencyProperty.Register("Category", typeof(string), typeof(PropertyItem), new UIPropertyMetadata(string.Empty, new PropertyChangedCallback(OnCategoryChanged), new CoerceValueCallback(OnCoerceCategory))); #region IsSelected
private static object OnCoerceCategory(DependencyObject o, object value) public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register("IsSelected", typeof(bool), typeof(PropertyItem), new UIPropertyMetadata(false, OnIsSelectedChanged));
public bool IsSelected
{ {
PropertyItem propertyItem = o as PropertyItem; get { return (bool)GetValue(IsSelectedProperty); }
if (propertyItem != null) set { SetValue(IsSelectedProperty, value); }
return propertyItem.OnCoerceCategory((string)value);
else
return value;
} }
private static void OnCategoryChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) private static void OnIsSelectedChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{ {
PropertyItem propertyItem = o as PropertyItem; PropertyItem propertyItem = o as PropertyItem;
if (propertyItem != null) if (propertyItem != null)
propertyItem.OnCategoryChanged((string)e.OldValue, (string)e.NewValue); propertyItem.OnIsSelectedChanged((bool)e.OldValue, (bool)e.NewValue);
} }
protected virtual string OnCoerceCategory(string value) protected virtual void OnIsSelectedChanged(bool oldValue, bool newValue)
{ {
// TODO: Keep the proposed value within the desired range. if (newValue)
return value; PropertyGrid.SelectedProperty = this;
} }
protected virtual void OnCategoryChanged(string oldValue, string newValue) #endregion //IsSelected
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
public string Category public bool IsWriteable { get { return !IsReadOnly; } }
{
// IMPORTANT: To maintain parity between setting a property in XAML and procedural code, do not touch the getter and setter inside this dependency property! public PropertyDescriptor PropertyDescriptor { get; private set; }
get
{ public PropertyGrid PropertyGrid { get; private set; }
return (string)GetValue(CategoryProperty);
}
set
{
SetValue(CategoryProperty, value);
}
}
public Type PropertyType { get { return PropertyDescriptor.PropertyType; } }
#region Editor #region Editor
public static readonly DependencyProperty EditorProperty = DependencyProperty.Register("Editor", typeof(FrameworkElement), typeof(PropertyItem), new UIPropertyMetadata(null, OnEditorChanged)); public static readonly DependencyProperty EditorProperty = DependencyProperty.Register("Editor", typeof(FrameworkElement), typeof(PropertyItem), new UIPropertyMetadata(null));
public FrameworkElement Editor public FrameworkElement Editor
{ {
get { return (FrameworkElement)GetValue(EditorProperty); } get { return (FrameworkElement)GetValue(EditorProperty); }
set { SetValue(EditorProperty, value); } set { SetValue(EditorProperty, value); }
} }
private static void OnEditorChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
PropertyItem propertyItem = o as PropertyItem;
if (propertyItem != null)
propertyItem.OnEditorChanged((FrameworkElement)e.OldValue, (FrameworkElement)e.NewValue);
}
protected virtual void OnEditorChanged(FrameworkElement oldValue, FrameworkElement newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //Editor #endregion //Editor
#endregion //Properties #endregion //Properties
@ -116,25 +78,24 @@ namespace Microsoft.Windows.Controls.PropertyGrid
DefaultStyleKeyProperty.OverrideMetadata(typeof(PropertyItem), new FrameworkPropertyMetadata(typeof(PropertyItem))); DefaultStyleKeyProperty.OverrideMetadata(typeof(PropertyItem), new FrameworkPropertyMetadata(typeof(PropertyItem)));
} }
public PropertyItem(object instance, PropertyDescriptor property) public PropertyItem(object instance, PropertyDescriptor property, PropertyGrid propertyGrid)
{ {
Instance = instance; Instance = instance;
PropertyDescriptor = property; PropertyDescriptor = property;
Name = PropertyDescriptor.Name; Name = PropertyDescriptor.Name;
Category = PropertyDescriptor.Category; Category = PropertyDescriptor.Category;
PropertyGrid = propertyGrid;
} }
#endregion //Constructor #endregion //Constructor
#region INotifyPropertyChanged Members #region Base Class Overrides
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected override void OnPreviewMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs e)
protected void OnPropertyChanged(string propertyName)
{ {
if (PropertyChanged != null) IsSelected = true;
PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} }
#endregion #endregion //Base Class Overrides
} }
} }

23
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml

@ -102,13 +102,15 @@
<Style TargetType="{x:Type local:PropertyItem}"> <Style TargetType="{x:Type local:PropertyItem}">
<Setter Property="BorderBrush" Value="#FFF0F0F0" /> <Setter Property="BorderBrush" Value="#FFF0F0F0" />
<Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="Focusable" Value="False"/>
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type local:PropertyItem}"> <ControlTemplate TargetType="{x:Type local:PropertyItem}">
<Border> <Border>
<Grid VerticalAlignment="Center" HorizontalAlignment="Stretch"> <Grid VerticalAlignment="Center" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding NameWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PropertyGrid}}}"/> <ColumnDefinition Width="{Binding NameColumnWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PropertyGrid}}}"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
@ -117,10 +119,19 @@
</Border> </Border>
<Border BorderThickness="0.5" BorderBrush="#FFF0F0F0" x:Name="PART_Editor" Grid.Column="1" Background="Transparent"> <Border BorderThickness="0.5" BorderBrush="#FFF0F0F0" x:Name="PART_Editor" Grid.Column="1" Background="Transparent">
<ContentControl Content="{TemplateBinding Editor}" VerticalAlignment="Center" /> <ContentControl Content="{TemplateBinding Editor}" VerticalAlignment="Center" Focusable="False" IsTabStop="False" />
</Border> </Border>
</Grid> </Grid>
</Border> </Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="PART_Name" Property="Background" Value="#CED4DF" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="PART_Name" Property="Background" Value="#43577B" />
<Setter TargetName="PART_Name" Property="TextElement.Foreground" Value="White" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
@ -165,7 +176,7 @@
<Grid Grid.Row="2" Background="White"> <Grid Grid.Row="2" Background="White">
<ScrollViewer VerticalScrollBarVisibility="Auto"> <ScrollViewer VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding Properties, RelativeSource={RelativeSource TemplatedParent}}" > <ItemsControl ItemsSource="{Binding Properties, RelativeSource={RelativeSource TemplatedParent}}" IsTabStop="False" Focusable="False" >
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<VirtualizingStackPanel /> <VirtualizingStackPanel />
@ -176,7 +187,7 @@
<Thumb x:Name="PART_DragThumb" HorizontalAlignment="Left" Width="5" Margin="6,0,0,0" Cursor="SizeWE"> <Thumb x:Name="PART_DragThumb" HorizontalAlignment="Left" Width="5" Margin="6,0,0,0" Cursor="SizeWE">
<Thumb.RenderTransform> <Thumb.RenderTransform>
<TranslateTransform X="{Binding NameWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PropertyGrid}}}" /> <TranslateTransform X="{Binding NameColumnWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PropertyGrid}}}" />
</Thumb.RenderTransform> </Thumb.RenderTransform>
<Thumb.Template> <Thumb.Template>
<ControlTemplate> <ControlTemplate>
@ -189,8 +200,8 @@
<GridSplitter Height="3" Grid.Row="3" HorizontalAlignment="Stretch" /> <GridSplitter Height="3" Grid.Row="3" HorizontalAlignment="Stretch" />
<StackPanel Grid.Row="4" Margin="0,0,0,5"> <StackPanel Grid.Row="4" Margin="0,0,0,5">
<TextBlock Padding="2 2 2 0" FontWeight="Bold" Text="Property Name" /> <TextBlock Padding="2 2 2 0" FontWeight="Bold" Text="{Binding SelectedProperty.Name, RelativeSource={RelativeSource TemplatedParent}}" />
<TextBlock Padding="5 2 2 0" TextWrapping="WrapWithOverflow" Text="Property Description" /> <TextBlock Padding="5 2 2 0" TextWrapping="WrapWithOverflow" Text="{Binding SelectedProperty.Description, RelativeSource={RelativeSource TemplatedParent}}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</Border> </Border>

Loading…
Cancel
Save