public void SetFilter(CollectionVM collection, FilterExpressionData filter)
 {
     _collection = collection;
     Elements    = collection.AvailableProperties;
     if (filter != null)
     {
         var fge = new FilterGroupEditor(collection, false, this.IsReadOnly, this);
         fge.SetFilter(filter);
         this.FilterExpr = filter;
         SetRootGroup(fge);
         if (filter != null)
         {
             gStartPanel.Visibility = Visibility.Collapsed;
             MyBorder.Visibility    = System.Windows.Visibility.Visible;
             if (!IsReadOnly)
             {
                 spButtons.Visibility = System.Windows.Visibility.Visible;
             }
         }
     }
     else
     {
         this.setProperty(PropertyDefinitionModel.GetEmpty());
     }
 }
Beispiel #2
0
 private void bAdd_Click(object sender, RoutedEventArgs e)
 {
     if (this.IsPopupMode)
     {
         popupFieldSelect.IsOpen = true;
     }
     else
     {
         this.setProperty(PropertyDefinitionModel.GetEmpty());
     }
 }
Beispiel #3
0
 private void bOr_Click(object sender, RoutedEventArgs e)
 {
     this.JoinType = eAndOrJoin.Or;
     if (this.IsPopupMode)
     {
         popupFieldSelect.IsOpen = true;
     }
     else
     {
         this.setProperty(PropertyDefinitionModel.GetEmpty());
     }
 }
 public void Reset(bool withRefresh = false)
 {
     _backgroundIndex = 0;
     mainGrid.Children.Clear();
     this.FilterExpr = null;
     if (!this.IsReadOnly)
     {
         if (IsPopupMode)
         {
             gStartPanel.Visibility = Visibility.Visible;
             MyBorder.Visibility    = Visibility.Collapsed;
             spButtons.Visibility   = Visibility.Collapsed;
         }
         else
         {
             this.setProperty(PropertyDefinitionModel.GetEmpty());
         }
     }
     //   spButtons.Visibility = Visibility.Collapsed;
     if (withRefresh && UpdateFilterFunction != null)
     {
         UpdateFilterFunction(null);
     }
 }