Fix adding block to a collapsed section
This commit is contained in:
parent
216168533f
commit
5817295f7c
|
@ -1036,9 +1036,23 @@ namespace Filtration.ViewModels
|
|||
}
|
||||
|
||||
private void OnAddBlockCommand()
|
||||
{
|
||||
var selectedBlockAsCommentBlock = SelectedBlockViewModel as IItemFilterCommentBlockViewModel;
|
||||
if(selectedBlockAsCommentBlock == null || selectedBlockAsCommentBlock.IsExpanded)
|
||||
{
|
||||
AddBlock(SelectedBlockViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
var sectionStart = ItemFilterBlockViewModels.IndexOf(selectedBlockAsCommentBlock);
|
||||
var sectionEnd = sectionStart + 1;
|
||||
while (sectionEnd < ItemFilterBlockViewModels.Count && ItemFilterBlockViewModels[sectionEnd] as IItemFilterCommentBlockViewModel == null)
|
||||
{
|
||||
sectionEnd++;
|
||||
}
|
||||
AddBlock(ItemFilterBlockViewModels[sectionEnd - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddBlock(IItemFilterBlockViewModelBase targetBlockViewModelBase)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue