mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-11-30 02:48:03 +08:00
fixed #487
This commit is contained in:
parent
4ef70ba91d
commit
594e86730d
@ -29,8 +29,8 @@ namespace HandyControl.Controls
|
||||
|
||||
public PropertyGrid()
|
||||
{
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.SortByCategory, SortByCategory));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.SortByName, SortByName));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.SortByCategory, SortByCategory, (s, e) => e.CanExecute = ShowSortButton));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.SortByName, SortByName, (s, e)=> e.CanExecute = ShowSortButton));
|
||||
}
|
||||
|
||||
public virtual PropertyResolver PropertyResolver { get; } = new PropertyResolver();
|
||||
@ -93,6 +93,15 @@ namespace HandyControl.Controls
|
||||
set => SetValue(MinTitleWidthProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ShowSortButtonProperty = DependencyProperty.Register(
|
||||
"ShowSortButton", typeof(bool), typeof(PropertyGrid), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||
|
||||
public bool ShowSortButton
|
||||
{
|
||||
get => (bool) GetValue(ShowSortButtonProperty);
|
||||
set => SetValue(ShowSortButtonProperty, value);
|
||||
}
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
if (_searchBar != null)
|
||||
|
@ -132,7 +132,7 @@
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<DockPanel LastChildFill="True" Margin="0,0,0,6">
|
||||
<hc:ButtonGroup Style="{StaticResource ButtonGroupSolid}">
|
||||
<hc:ButtonGroup Margin="0,0,6,0" Visibility="{Binding ShowSortButton,RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource ButtonGroupSolid}">
|
||||
<RadioButton Command="interactivity:ControlCommands.SortByCategory" IsChecked="True">
|
||||
<Rectangle Width="16" Height="16" Fill="{StaticResource SortByCategoryDrawingBrush}"/>
|
||||
</RadioButton>
|
||||
@ -140,7 +140,7 @@
|
||||
<Rectangle Width="16" Height="16" Fill="{StaticResource SortByNameDrawingBrush}"/>
|
||||
</RadioButton>
|
||||
</hc:ButtonGroup>
|
||||
<hc:SearchBar x:Name="PART_SearchBar" IsRealTime="True" Margin="6,0,0,0" ShowClearButton="True" Style="{StaticResource SearchBarPlus}"/>
|
||||
<hc:SearchBar x:Name="PART_SearchBar" IsRealTime="True" ShowClearButton="True" Style="{StaticResource SearchBarPlus}"/>
|
||||
</DockPanel>
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<hc:PropertyItemsControl x:Name="PART_ItemsControl" Style="{StaticResource PropertyItemsControlBaseStyle}">
|
||||
|
Loading…
Reference in New Issue
Block a user