internal static void ShowFilterPanel(
            AutoColumnFilterBody headerBody,
            Point point)
        {
            if (popupSingleton != null)
            {
                popupSingleton.IsOpen    = false;
                popupSingleton.StaysOpen = false;
                popupSingleton           = null;
            }

            var popup = new Popup
            {
                Child     = new ColumnFilterContextMenu(headerBody),
                Placement = PlacementMode.Mouse,
                IsOpen    = true,
                StaysOpen = true
            };

            // TODO : CLose when click outside
            popup.Child.Focus();
            DependencyPropertyChangedEventHandler handler = null;

            handler = (x, y) =>
            {
                popup.IsOpen    = false;
                popup.StaysOpen = false;
                popup.IsKeyboardFocusWithinChanged -= handler;
                popupSingleton = null;
            };

            popup.IsKeyboardFocusWithinChanged += handler;
            popupSingleton = popup;
        }
Exemple #2
0
        internal bool RaiseFilterButtonPress(AutoColumnFilterBody headerBody, Point point)
        {
            if (headerBody.ColumnHeader == null)
            {
                return(false);
            }

            if (FilterButtonPressed != null)
            {
                var arg = new FilterButtonPressedEventArgs(headerBody.ColumnHeader);

                FilterButtonPressed(this, arg);

                if (arg.IsCancelled)
                {
                    return(true);
                }
            }

            if (this.columnFilterUIFlag == AutoColumnFilterUI.DropdownButtonAndPanel)
            {
#if WINFORM
                unvell.ReoGrid.WinForm.ColumnFilterContextMenu.ShowFilterPanel(headerBody, (System.Drawing.Point)point);
#elif WPF
                // todo
#endif // WPF
                return(true);
            }

            return(false);
        }
 private ColumnFilterContextMenu(AutoColumnFilterBody headerBody)
 {
     this.InitializeComponent();
     this.headerBody = headerBody;
 }
Exemple #4
0
 internal TextFilterCollection(AutoColumnFilterBody column)
 {
     this.columnFilter = column;
 }