Add clear all button & missing functions
This commit is contained in:
parent
2ff9ebf242
commit
99a011c78c
|
@ -21,6 +21,9 @@ namespace Filtration.ViewModels.ToolPanes
|
|||
public BlockGroupBrowserViewModel() : base("Block Group Browser")
|
||||
{
|
||||
FilterToSelectedBlockGroupCommand = new RelayCommand(OnFilterToSelectedBlockGroupCommand, () => SelectedBlockGroupViewModel != null);
|
||||
ClearAllFiltersCommand = new RelayCommand(OnClearAllFiltersCommand);
|
||||
ExpandAllCommand = new RelayCommand(OnExpandAllCommand);
|
||||
CollapseAllCommand = new RelayCommand(OnCollapseAllCommand);
|
||||
|
||||
ContentId = ToolContentId;
|
||||
var icon = new BitmapImage();
|
||||
|
@ -71,7 +74,13 @@ namespace Filtration.ViewModels.ToolPanes
|
|||
}
|
||||
|
||||
public RelayCommand FilterToSelectedBlockGroupCommand { get; }
|
||||
|
||||
|
||||
public RelayCommand ClearAllFiltersCommand { get; }
|
||||
|
||||
public RelayCommand ExpandAllCommand { get; }
|
||||
|
||||
public RelayCommand CollapseAllCommand { get; }
|
||||
|
||||
public ObservableCollection<ItemFilterBlockGroupViewModel> BlockGroupViewModels
|
||||
{
|
||||
get => _blockGroupViewModelViewModels;
|
||||
|
@ -107,5 +116,26 @@ namespace Filtration.ViewModels.ToolPanes
|
|||
AvalonDockWorkspaceViewModel.ActiveScriptViewModel.BlockFilterPredicate =
|
||||
b => b.Block.HasBlockGroupInParentHierarchy(SelectedBlockGroupViewModel.SourceBlockGroup, b.Block.BlockGroup);
|
||||
}
|
||||
|
||||
private void OnClearAllFiltersCommand()
|
||||
{
|
||||
AvalonDockWorkspaceViewModel.ActiveScriptViewModel?.ClearFilterCommand.Execute(null);
|
||||
}
|
||||
|
||||
private void OnExpandAllCommand()
|
||||
{
|
||||
foreach (var vm in BlockGroupViewModels)
|
||||
{
|
||||
vm.IsExpanded = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCollapseAllCommand()
|
||||
{
|
||||
foreach (var vm in BlockGroupViewModels)
|
||||
{
|
||||
vm.IsExpanded = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,13 +21,20 @@
|
|||
</Grid.RowDefinitions>
|
||||
<ToolBar Grid.Row="0">
|
||||
<Button Height="20" Command="{Binding FilterToSelectedBlockGroupCommand}" Content="{StaticResource FilterIcon}" ToolTip="Filter to Selected Block Group" />
|
||||
<Button Height="20" Content="{StaticResource ExpandIcon}" ToolTip="Expand All (Not Implemented)" Name="ExpandAllButton" />
|
||||
<Button Height="20" Content="{StaticResource CollapseIcon}" ToolTip="Collapse All (Not Implemented)" Name="CollapseAllButton" />
|
||||
<Button Height="20" Command="{Binding ClearAllFiltersCommand}" Content="{StaticResource ClearFilterIcon}" ToolTip="Clear All Filters" />
|
||||
<Button Height="20" Command="{Binding ExpandAllCommand}" Content="{StaticResource ExpandIcon}" ToolTip="Expand All" Name="ExpandAllButton" />
|
||||
<Button Height="20" Command="{Binding CollapseAllCommand}" Content="{StaticResource CollapseIcon}" ToolTip="Collapse All" Name="CollapseAllButton" />
|
||||
</ToolBar>
|
||||
<TreeView Grid.Row="1" ItemsSource="{Binding BlockGroupViewModels}" Name="TreeView">
|
||||
<i:Interaction.Behaviors>
|
||||
<behaviors:BindableSelectedItemBehavior SelectedItem="{Binding SelectedBlockGroupViewModel, Mode=OneWayToSource}" />
|
||||
</i:Interaction.Behaviors>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
</Setter>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type viewModels:ItemFilterBlockGroupViewModel}" ItemsSource="{Binding ChildGroups}">
|
||||
<WrapPanel>
|
||||
|
|
Loading…
Reference in New Issue