public TabDocumentGroupControl(Group group) { InitializeComponent(); Group = group; DeselectedBlocks = new List<Block>(); }
public bool HasGroup(Group group) { return Groups.Any(p => p.Equals(group)); }
private void AddTabItem(Group group) { var item = new TabItem() { Header = group.Name, Content = new TabDocumentGroupControl(group) }; tabControlMain.Items.Add(item); }
private bool AllowBlockFilter(Block target, Group currentGroup, List<Block> deselectedBlocks) { return (deselectedBlocks.Count == 0 || deselectedBlocks.All(p => p.Order != target.Order)) && (currentGroup.IsAll || target.HasGroup(currentGroup)); }
public void InvokeSearch() { if (_daxManager.CanSearch) { InputControls.ToList().ForEach(p => p.IsHighlighted = false); var inputs = InputControls.Where(p => p.IsSelected) .Where(p => p.Context.AllowBlank || !p.IsBlank) .ToList(); inputs.ForEach(p => p.IsHighlighted = true); var deselectedGroups = BlockControls .Where(p => !p.IsSelected) .Select(p => p.Block) .ToList(); CurrentTab.DeselectedBlocks.Clear(); CurrentTab.DeselectedBlocks.AddRange(deselectedGroups); if (BlockControls.All(p => !p.IsSelected)) { CurrentTab.DeselectedBlocks.Clear(); } _currentGroup = CurrentTab.Group; List<Block> deselectedBlocks = CurrentTab.DeselectedBlocks; var inputValues = inputs.ToDictionary(p => p.InputName, p => p.InputValue); _daxManager.SearchAsync(inputValues, b => AllowBlockFilter(b, _currentGroup, deselectedBlocks)); } }