Example #1
0
        private a7ComboBox getBoolFilter(PropertyDefinitionModel field)
        {
            a7ComboBox cb = new a7ComboBox();

            cb.SelectedValuePath = "Value";
            cb.DisplayMemberPath = "Name";
            cb.Width             = 120;
            var items = new ObservableCollection <comboItem>();

            items.Add(new comboItem("1", "Yes"));
            items.Add(new comboItem("0", "No"));
            cb.ItemsSource         = items;
            cb.Background          = Brushes.White;
            cb.Template            = ResourcesManager.Instance.GetControlTemplate("CustomComboBox");
            cb.Padding             = new Thickness(0.0);
            cb.Margin              = new Thickness(0.0);
            cb.HorizontalAlignment = HorizontalAlignment.Stretch;
            cb.BorderBrush         = ResourcesManager.Instance.GetBrush("IsReadOnlyBorderBrush");
            cb.SetBinding(a7ComboBox.SelectedValueProperty, getFilterValueBinding());
            cb.SetBinding(a7ComboBox.IsEnabledProperty, getIsEnabledBinding());
            cb.Height            = 18;
            cb.FontSize          = 12;
            cb.SelectionChanged += (s, e) => activateFilter();
            return(cb);
        }
Example #2
0
        private a7ComboBox getCombo(PropertyDefinitionModel field)
        {
            a7ComboBox cb = new a7ComboBox();

            (Filter as FltAtomExprData).Operator = FilterFieldOperator.Equal;
            cb.Width               = 120;
            cb.Height              = 18;
            cb.Template            = ResourcesManager.Instance.GetControlTemplate("CustomComboBox");
            cb.Padding             = new Thickness(0.0);
            cb.Margin              = new Thickness(0.0);
            cb.HorizontalAlignment = HorizontalAlignment.Stretch;
            cb.Background          = Brushes.White;                                               //todo: ugly hardcode! :D
            cb.BorderBrush         = ResourcesManager.Instance.GetBrush("IsReadOnlyBorderBrush"); //and here
            cb.Height              = 18;                                                          //yup, hardcode
            //cb.DisplayMemberPath = "DisplayName";
            cb.ItemTemplate      = a7ComboBox.CustomItemTemplate;
            cb.SelectedValuePath = "Id";
            cb.SetBinding(a7ComboBox.SelectedValueProperty, getFilterValueBinding());
            cb.SetBinding(a7ComboBox.IsEnabledProperty, getIsEnabledBinding());
            //cb.ItemsSource = a7Core.Instance.DataSourceManager.GetDataSourceItems(field.DataSourceId, bx).Collection;
            cb.SelectionChanged += (s, e) => activateFilter();
            return(cb);
        }
 private a7ComboBox getCombo(PropertyDefinitionModel field)
 {
     a7ComboBox cb = new a7ComboBox();
     (Filter as FltAtomExprData).Operator = FilterFieldOperator.Equal;
     cb.Width = 120;
     cb.Height = 18;
     cb.Template = ResourcesManager.Instance.GetControlTemplate("CustomComboBox");
     cb.Padding = new Thickness(0.0);
     cb.Margin = new Thickness(0.0);
     cb.HorizontalAlignment = HorizontalAlignment.Stretch;
     cb.Background = Brushes.White; //todo: ugly hardcode! :D
     cb.BorderBrush = ResourcesManager.Instance.GetBrush("IsReadOnlyBorderBrush"); //and here
     cb.Height = 18; //yup, hardcode
     //cb.DisplayMemberPath = "DisplayName";
     cb.ItemTemplate = a7ComboBox.CustomItemTemplate;
     cb.SelectedValuePath = "Id";
     cb.SetBinding(a7ComboBox.SelectedValueProperty, getFilterValueBinding());
     cb.SetBinding(a7ComboBox.IsEnabledProperty, getIsEnabledBinding());
     //cb.ItemsSource = a7Core.Instance.DataSourceManager.GetDataSourceItems(field.DataSourceId, bx).Collection;
     cb.SelectionChanged += (s, e) => activateFilter();
     return cb;
 }
 private a7ComboBox getBoolFilter(PropertyDefinitionModel field)
 {
     a7ComboBox cb = new a7ComboBox();
     cb.SelectedValuePath = "Value";
     cb.DisplayMemberPath = "Name";
     cb.Width = 120;
     var items = new ObservableCollection<comboItem>();
     items.Add(new comboItem("1", "Yes"));
     items.Add(new comboItem("0", "No"));
     cb.ItemsSource = items;
     cb.Background = Brushes.White;
     cb.Template = ResourcesManager.Instance.GetControlTemplate("CustomComboBox");
     cb.Padding = new Thickness(0.0);
     cb.Margin = new Thickness(0.0);
     cb.HorizontalAlignment = HorizontalAlignment.Stretch;
     cb.BorderBrush = ResourcesManager.Instance.GetBrush("IsReadOnlyBorderBrush");
     cb.SetBinding(a7ComboBox.SelectedValueProperty, getFilterValueBinding());
     cb.SetBinding(a7ComboBox.IsEnabledProperty, getIsEnabledBinding());
     cb.Height = 18;
     cb.FontSize = 12;
     cb.SelectionChanged += (s, e) => activateFilter();
     return cb;
 }