Fix block group output & expand/collapse all
This commit is contained in:
parent
4bed777427
commit
1ee38b4c0e
|
@ -57,18 +57,17 @@ namespace Filtration.ObjectModel
|
|||
|
||||
public override string ToString()
|
||||
{
|
||||
var currentBlockGroup = this;
|
||||
if(ParentGroup == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var outputString = (Advanced ? "~" : string.Empty) + GroupName;
|
||||
|
||||
// TODO: This is retarded, fix this.
|
||||
if (currentBlockGroup.ParentGroup != null)
|
||||
var parentOutput = ParentGroup.ToString();
|
||||
if(!string.IsNullOrWhiteSpace(parentOutput))
|
||||
{
|
||||
while (currentBlockGroup.ParentGroup.ParentGroup != null)
|
||||
{
|
||||
outputString = (currentBlockGroup.ParentGroup.Advanced ? "~" : string.Empty) + currentBlockGroup.ParentGroup.GroupName + " - " + outputString;
|
||||
currentBlockGroup = currentBlockGroup.ParentGroup;
|
||||
}
|
||||
outputString = parentOutput + (IsLeafNode ? string.Empty : " - " + outputString);
|
||||
}
|
||||
|
||||
return outputString;
|
||||
|
|
|
@ -166,6 +166,15 @@ namespace Filtration.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
public void SetIsExpandedForAll(bool isExpanded)
|
||||
{
|
||||
IsExpanded = isExpanded;
|
||||
foreach(var child in VisibleChildGroups)
|
||||
{
|
||||
child.SetIsExpandedForAll(isExpanded);
|
||||
}
|
||||
}
|
||||
|
||||
public void RecalculateCheckState()
|
||||
{
|
||||
_isShowChecked = DetermineCheckState(true);
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace Filtration.ViewModels.ToolPanes
|
|||
{
|
||||
foreach (var vm in BlockGroupViewModels)
|
||||
{
|
||||
vm.IsExpanded = true;
|
||||
vm.SetIsExpandedForAll(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ namespace Filtration.ViewModels.ToolPanes
|
|||
{
|
||||
foreach (var vm in BlockGroupViewModels)
|
||||
{
|
||||
vm.IsExpanded = false;
|
||||
vm.SetIsExpandedForAll(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue