Example #1
0
        public CFilterControl(Popup pppParent,
                              enFilterTarget filterTarget,
                              List <FilterPredicate> predicates,
                              FilterControlCommandHandler FilterCommandFunc,
                              FilterControlCommandHandler CancelCommandFunc)
        {
            InitializeComponent();

            ParentPopup  = pppParent;
            FilterTarget = filterTarget;
            CloseReason  = enCloseReason.LostFocus;

            m_FilterPredicatesOnOpen = new List <FilterPredicate>();

            foreach (FilterPredicate predicate in predicates)
            {
                FilterPredicate NewPredicate = new FilterPredicate(predicate);
                NewPredicate.PropertyChanged += Predicate_PropertyChanged;
                FilterPredicates.Add(NewPredicate);

                m_FilterPredicatesOnOpen.Add(new FilterPredicate(predicate));
            }

            CancelCommand = new CCommand(() =>
            {
                CloseReason = enCloseReason.Cancel;
                CancelCommandFunc(this);
            });
            FilterCommand = new CCommand(() =>
            {
                CloseReason = enCloseReason.OK;
                FilterCommandFunc(this);
            });
            Predicate_PropertyChanged(this, null);
        }
Example #2
0
 public FilterPredicate(FilterPredicate rhs)
 {
     IsSelected  = rhs.IsSelected;
     FilterValue = rhs.FilterValue;
     Name        = rhs.Name;
 }