Exemplo n.º 1
0
        public SymbolFilterBox(ISymbolFilterable filter)
        {
            Orientation = Orientation.Horizontal;
            Margin      = WpfHelper.MenuItemMargin;
            Children.Add(ThemeHelper.GetImage(IconIds.Filter).WrapMargin(WpfHelper.GlyphMargin));
            Children.Add(_FilterBox = new ThemedTextBox {
                MinWidth = 150,
                Margin   = WpfHelper.GlyphMargin,
                ToolTip  = new ThemedToolTip(R.T_ResultFilter, R.T_ResultFilterTip)
            });
            Children.Add(new Border {
                BorderThickness = WpfHelper.TinyMargin,
                CornerRadius    = new CornerRadius(3),
                Child           = _FilterContainer = new StackPanel {
                    Orientation = Orientation.Horizontal
                }
            }.ReferenceProperty(Border.BorderBrushProperty, CommonControlsColors.TextBoxBorderBrushKey));
            switch (filter.SymbolFilterKind)
            {
            case SymbolFilterKind.Type:
                _FilterGroups = new FilterButtonGroup[] { new AccessibilityFilterButtonGroup(), new TypeFilterButtonGroup() };
                break;

            case SymbolFilterKind.Usage:
                _FilterGroups = new FilterButtonGroup[] { new AccessibilityFilterButtonGroup(), new SymbolUsageFilterButtonGroup(), new MemberFilterButtonGroup() };
                break;

            default:
                _FilterGroups = new FilterButtonGroup[] { new AccessibilityFilterButtonGroup(), new MemberFilterButtonGroup() };
                break;
            }
            _FilterContainer.Add(_FilterGroups);
            _FilterContainer.Add(new ThemedButton(IconIds.ClearFilter, R.CMD_ClearFilter, ClearFilters).ClearBorder());
            _Filter = filter;
            foreach (var item in _FilterGroups)
            {
                item.FilterChanged += FilterBox_Changed;
            }
            _FilterBox.TextChanged += FilterBox_Changed;
            _FilterBox.SetOnVisibleSelectAll();
        }
Exemplo n.º 2
0
 public SymbolFilterBox(ISymbolFilterable filter)
 {
     Orientation = Orientation.Horizontal;
     Margin      = WpfHelper.MenuItemMargin;
     Children.Add(ThemeHelper.GetImage(KnownImageIds.Filter).WrapMargin(WpfHelper.GlyphMargin));
     Children.Add(_FilterBox = new ThemedTextBox(true)
     {
         MinWidth = 150,
         ToolTip  = new ThemedToolTip("Result Filter", "Filter items in this menu.\nUse space to separate keywords.")
     });
     if (filter.SymbolFilterKind == SymbolFilterKind.Type)
     {
         Children.Add(_FilterButtons = new TypeFilterButtonGroup());
     }
     else
     {
         Children.Add(_FilterButtons = new MemberFilterButtonGroup());
     }
     _Filter = filter;
     _FilterButtons.FilterChanged += FilterBox_Changed;
     _FilterButtons.FilterCleared += FilterBox_Clear;
     _FilterBox.TextChanged       += FilterBox_Changed;
     _FilterBox.SetOnVisibleSelectAll();
 }