Browse Source

PropertyGrid: added ShowSortOptions and ShowSearchBox properties that will allow you to control the visibility of the Categorize/Alpha sort optiosna dnt he search text box.

pull/1645/head
brianlagunas_cp 14 years ago
parent
commit
63e65e47b9
  1. 22
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs
  2. 4
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Themes/Generic.xaml

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

@ -297,6 +297,28 @@ namespace Microsoft.Windows.Controls.PropertyGrid
#endregion //ShowAdvancedOptions #endregion //ShowAdvancedOptions
#region ShowSearchBox
public static readonly DependencyProperty ShowSearchBoxProperty = DependencyProperty.Register("ShowSearchBox", typeof(bool), typeof(PropertyGrid), new UIPropertyMetadata(true));
public bool ShowSearchBox
{
get { return (bool)GetValue(ShowSearchBoxProperty); }
set { SetValue(ShowSearchBoxProperty, value); }
}
#endregion //ShowSearchBox
#region ShowSortOptions
public static readonly DependencyProperty ShowSortOptionsProperty = DependencyProperty.Register("ShowSortOptions", typeof(bool), typeof(PropertyGrid), new UIPropertyMetadata(true));
public bool ShowSortOptions
{
get { return (bool)GetValue(ShowSortOptionsProperty); }
set { SetValue(ShowSortOptionsProperty, value); }
}
#endregion //ShowSortOptions
#endregion //Properties #endregion //Properties
#region Constructors #region Constructors

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

@ -399,7 +399,7 @@
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid Background="#BCC7D8" Margin="4"> <Grid Background="#BCC7D8" Margin="4" Visibility="{Binding ShowSortOptions, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" >
<StackPanel Orientation="Horizontal" Margin="1" > <StackPanel Orientation="Horizontal" Margin="1" >
<RadioButton IsChecked="{Binding IsCategorized, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" <RadioButton IsChecked="{Binding IsCategorized, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"
Style="{StaticResource OptionsToggleButtonStyle}" ToolTip="Categorized"> Style="{StaticResource OptionsToggleButtonStyle}" ToolTip="Categorized">
@ -412,7 +412,7 @@
</StackPanel> </StackPanel>
</Grid> </Grid>
<Border Grid.Column="1" Margin="4,4,0,4" Background="White" BorderBrush="Gray" BorderThickness="1" > <Border Grid.Column="1" Margin="4,4,0,4" Background="White" BorderBrush="Gray" BorderThickness="1" Visibility="{Binding ShowSearchBox, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" >
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />

Loading…
Cancel
Save