Interaction logic for a7FilterEditor.xaml
Inheritance: System.Windows.Controls.UserControl, INotifyPropertyChanged
 public FilterGroupEditor(CollectionVM collection, bool vertical, bool isReadOnly, FilterEditor editorContext)
 {
     InitializeComponent();
     this.IsPopupMode = editorContext.IsPopupMode;
     EditorContext = editorContext;
     _collection = collection;
     if (collection != null)
         Elements = collection.AvailableProperties;
     else
         Elements = new List<PropertyDefinitionModel>();
     SubGroups = new List<FilterGroupEditor>();
     _vertical = vertical;
     this.VerticalAlignment = VerticalAlignment.Center;
     this.HorizontalAlignment = HorizontalAlignment.Center;
     if (!_vertical)
         Orientation = Orientation.Horizontal;
     else
         Orientation = Orientation.Vertical;
     IsReadOnly = false;
     popupFieldSelect.Opened += (sender, args) =>
                                    {
                                        if (EditorContext != null)
                                            EditorContext.EntityFieldsPopups.Add(popupFieldSelect);
                                    };
     this.IsReadOnly = isReadOnly;
 }
        public override void OnApplyTemplate()
        {
            DependencyObject fePopup = GetTemplateChild("fePopup");

            if (fePopup != null)
            {
                _fePopup         = fePopup as Popup;
                _fePopup.Opened += new EventHandler(_fePopup_Opened);
                _fePopup.Closed += new EventHandler(_fePopup_Closed);
            }
            var fePopupControl = GetTemplateChild("fePopupControl");

            if (fePopupControl != null)
            {
                _fePopupControl = fePopupControl as FilterEditor;
                if (_collection != null)
                {
                    _fePopupControl.SetCollection(_collection);
                }
                if (FilterExpr != null)
                {
                    _fePopupControl.SetFilter(_collection, FilterExpr);
                }
            }
            this.myWindow = Window.GetWindow(this);
            if (myWindow != null)
            {
                this.myWindow.PreviewMouseDown += new MouseButtonEventHandler(myWindow_PreviewMouseDown);
            }

            if (UpdateFilterFunction != null)
            {
                _fePopupControl.UpdateFilterFunction = UpdateFilter;
            }
            _fePopupControl.SetBinding(FilterEditor.IsReadOnlyProperty, new Binding("IsReadOnly")
            {
                Source = this
            });
        }
Ejemplo n.º 3
0
 public FilterGroupEditor(CollectionVM collection, bool vertical, bool isReadOnly, FilterEditor editorContext)
 {
     InitializeComponent();
     this.IsPopupMode = editorContext.IsPopupMode;
     EditorContext    = editorContext;
     _collection      = collection;
     if (collection != null)
     {
         Elements = collection.AvailableProperties;
     }
     else
     {
         Elements = new List <PropertyDefinitionModel>();
     }
     SubGroups = new List <FilterGroupEditor>();
     _vertical = vertical;
     this.VerticalAlignment   = VerticalAlignment.Center;
     this.HorizontalAlignment = HorizontalAlignment.Center;
     if (!_vertical)
     {
         Orientation = Orientation.Horizontal;
     }
     else
     {
         Orientation = Orientation.Vertical;
     }
     IsReadOnly = false;
     popupFieldSelect.Opened += (sender, args) =>
     {
         if (EditorContext != null)
         {
             EditorContext.EntityFieldsPopups.Add(popupFieldSelect);
         }
     };
     this.IsReadOnly = isReadOnly;
 }
 public FilterGroupEditor(CollectionVM collection, bool vertical, bool isReadOnly, FilterEditor editorContext, FilterExpressionData filter)
     : this(collection, vertical, isReadOnly, editorContext)
 {
     SetFilter(filter);
 }
        public override void OnApplyTemplate()
        {
            DependencyObject fePopup = GetTemplateChild("fePopup");
            if (fePopup != null)
            {
                _fePopup = fePopup as Popup;
                _fePopup.Opened += new EventHandler(_fePopup_Opened);
                _fePopup.Closed += new EventHandler(_fePopup_Closed);
            }
            var fePopupControl = GetTemplateChild("fePopupControl");
            if (fePopupControl != null)
            {
                _fePopupControl = fePopupControl as FilterEditor;
                if(_collection != null)
                    _fePopupControl.SetCollection(_collection);
                if (FilterExpr != null)
                    _fePopupControl.SetFilter(_collection, FilterExpr);
            }
            this.myWindow = Window.GetWindow(this);
            if(myWindow!=null)
                this.myWindow.PreviewMouseDown += new MouseButtonEventHandler(myWindow_PreviewMouseDown);

            if (UpdateFilterFunction != null)
            {
                _fePopupControl.UpdateFilterFunction = UpdateFilter;
            }
            _fePopupControl.SetBinding(FilterEditor.IsReadOnlyProperty, new Binding("IsReadOnly") { Source = this });
        }
Ejemplo n.º 6
0
 public FilterGroupEditor(CollectionVM collection, bool vertical, bool isReadOnly, FilterEditor editorContext, FilterExpressionData filter)
     : this(collection, vertical, isReadOnly, editorContext)
 {
     SetFilter(filter);
 }