Browse Source

PropertyGrid: added DisplaySummary property to allow you to show/hide the Suammry area

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
608eedf9c5
  1. 15
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs
  2. 5
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml

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

@ -57,7 +57,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid
#endregion //IsCategorized #endregion //IsCategorized
#region NameWidth #region NameColumnWidth
public static readonly DependencyProperty NameColumnWidthProperty = DependencyProperty.Register("NameColumnWidth", typeof(double), typeof(PropertyGrid), new UIPropertyMetadata(150.0)); public static readonly DependencyProperty NameColumnWidthProperty = DependencyProperty.Register("NameColumnWidth", typeof(double), typeof(PropertyGrid), new UIPropertyMetadata(150.0));
public double NameColumnWidth public double NameColumnWidth
@ -66,7 +66,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid
set { SetValue(NameColumnWidthProperty, value); } set { SetValue(NameColumnWidthProperty, value); }
} }
#endregion //NameWidth #endregion //NameColumnWidth
#region Properties #region Properties
@ -180,6 +180,17 @@ namespace Microsoft.Windows.Controls.PropertyGrid
#endregion //SelectedProperty #endregion //SelectedProperty
#region DisplaySummary
public static readonly DependencyProperty DisplaySummaryProperty = DependencyProperty.Register("DisplaySummary", typeof(bool), typeof(PropertyGrid), new UIPropertyMetadata(true));
public bool DisplaySummary
{
get { return (bool)GetValue(DisplaySummaryProperty); }
set { SetValue(DisplaySummaryProperty, value); }
}
#endregion //DisplaySummary
#endregion //Properties #endregion //Properties
#region Constructors #region Constructors

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

@ -10,6 +10,7 @@
<!-- PropertyGrid --> <!-- PropertyGrid -->
<!-- =============================================================================== --> <!-- =============================================================================== -->
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:InverseBoolConverter x:Key="InverseBoolConverter" /> <converters:InverseBoolConverter x:Key="InverseBoolConverter" />
<pgConverters:ValueSourceToImagePathConverter x:Key="ValueSourceToImagePathConverter" /> <pgConverters:ValueSourceToImagePathConverter x:Key="ValueSourceToImagePathConverter" />
<pgConverters:ValueSourceToToolTipConverter x:Key="ValueSourceToToolTipConverter" /> <pgConverters:ValueSourceToToolTipConverter x:Key="ValueSourceToToolTipConverter" />
@ -353,8 +354,8 @@
</Grid> </Grid>
<GridSplitter Height="3" Grid.Row="3" HorizontalAlignment="Stretch" /> <GridSplitter Height="3" Grid.Row="3" HorizontalAlignment="Stretch" Visibility="{Binding DisplaySummary, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" />
<StackPanel Grid.Row="4" Margin="0,0,0,5"> <StackPanel Grid.Row="4" Margin="0,0,0,5" Visibility="{Binding DisplaySummary, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock Padding="2 2 2 0" FontWeight="Bold" Text="{Binding SelectedProperty.Name, RelativeSource={RelativeSource TemplatedParent}}" /> <TextBlock Padding="2 2 2 0" FontWeight="Bold" Text="{Binding SelectedProperty.Name, RelativeSource={RelativeSource TemplatedParent}}" />
<TextBlock Padding="5 2 2 0" TextWrapping="WrapWithOverflow" Text="{Binding SelectedProperty.Description, RelativeSource={RelativeSource TemplatedParent}}" /> <TextBlock Padding="5 2 2 0" TextWrapping="WrapWithOverflow" Text="{Binding SelectedProperty.Description, RelativeSource={RelativeSource TemplatedParent}}" />
</StackPanel> </StackPanel>

Loading…
Cancel
Save