コード例 #1
0
        private IEnumerable <OutlineItemViewModel> Flatten(OutlineItemViewModel item)
        {
            foreach (var child in item.Children)
            {
                yield return(child);

                foreach (var flatChild in Flatten(child))
                {
                    yield return(flatChild);
                }
            }
        }
コード例 #2
0
 private bool ExistsExpanded(OutlineItemViewModel item, OutlineItemViewModel[] ownItems)
 {
     return(ownItems.FirstOrDefault(e => e.Data.Text == item.Data.Text || e.Data.TextPosition == item.Data.TextPosition)?.IsExpanded ?? false);
 }