Fix block group changes not affecting script (#101)
This commit is contained in:
parent
e516ded476
commit
124786dd0d
Filtration/ViewModels
@ -28,7 +28,6 @@ namespace Filtration.ViewModels
|
||||
ParentGroup = parent;
|
||||
Advanced = itemFilterBlockGroup.Advanced;
|
||||
SourceBlockGroup = itemFilterBlockGroup;
|
||||
SourceBlockGroup.ClearStatusChangeSubscribers();
|
||||
SourceBlockGroup.BlockGroupStatusChanged += OnSourceBlockGroupStatusChanged;
|
||||
IsShowChecked = itemFilterBlockGroup.IsShowChecked;
|
||||
IsEnableChecked = itemFilterBlockGroup.IsEnableChecked;
|
||||
@ -256,5 +255,18 @@ namespace Filtration.ViewModels
|
||||
IsEnableChecked = SourceBlockGroup.IsEnableChecked;
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearStatusChangeSubscriptions()
|
||||
{
|
||||
if (SourceBlockGroup != null)
|
||||
{
|
||||
SourceBlockGroup.BlockGroupStatusChanged -= OnSourceBlockGroupStatusChanged;
|
||||
}
|
||||
|
||||
foreach (var child in ChildGroups)
|
||||
{
|
||||
child.ClearStatusChangeSubscriptions();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -107,6 +107,14 @@ namespace Filtration.ViewModels.ToolPanes
|
||||
|
||||
private ObservableCollection<ItemFilterBlockGroupViewModel> RebuildBlockGroupViewModels(bool showAdvanced)
|
||||
{
|
||||
if (BlockGroupViewModels != null)
|
||||
{
|
||||
foreach (var viewModel in BlockGroupViewModels)
|
||||
{
|
||||
viewModel.ClearStatusChangeSubscriptions();
|
||||
}
|
||||
}
|
||||
|
||||
// This assumes that there will only ever be a single root node.
|
||||
return new ObservableCollection<ItemFilterBlockGroupViewModel>
|
||||
(
|
||||
|
Loading…
x
Reference in New Issue
Block a user