Set BlockGroupsEnabled based on group count (#137)

Changes setting based on the count of blocks in script, related #130
This commit is contained in:
azakhi 2019-09-11 14:42:28 +03:00 committed by Ben Wallis
parent 785524f3ab
commit 757fc46e6b
1 changed files with 6 additions and 0 deletions

View File

@ -624,6 +624,7 @@ namespace Filtration.ViewModels
Block.IsEdited = true;
_parentScriptViewModel.SetDirtyFlag();
_parentScriptViewModel.Script.ItemFilterScriptSettings.BlockGroupsEnabled = true;
Messenger.Default.Send(new NotificationMessage<bool>(_parentScriptViewModel.ShowAdvanced, "BlockGroupsChanged"));
UpdateBlockGroups();
@ -652,6 +653,11 @@ namespace Filtration.ViewModels
Messenger.Default.Send(new NotificationMessage<bool>(_parentScriptViewModel.ShowAdvanced, "BlockGroupsChanged"));
UpdateBlockGroups();
if (BlockGroups.Count <= 0)
{
_parentScriptViewModel.Script.ItemFilterScriptSettings.BlockGroupsEnabled = false;
}
}
}