public ValueFilterControl()
        {
            Grid LayoutRoot = new Grid();

            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(2, GridUnitType.Star) });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(2, GridUnitType.Star) });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());

            LayoutRoot.RowDefinitions.Add(new RowDefinition());
            LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(24) });
            LayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Мера куба
            comboMeasure = new MeasuresCombo() { Margin = new Thickness(0) };
            LayoutRoot.Children.Add(comboMeasure);
            Grid.SetColumn(comboMeasure, 0);
            Grid.SetRow(comboMeasure, 1);

            // Тип фильтра
            comboFilterType = new ValueFilterTypeCombo() { Margin = new Thickness(5, 0, 0, 0) };
            comboFilterType.SelectionChanged += new SelectionChangedEventHandler(comboFilterType_SelectionChanged);
            LayoutRoot.Children.Add(comboFilterType);
            Grid.SetRow(comboFilterType, 1);
            Grid.SetColumn(comboFilterType, 1);

            // Количество записей
            numCount_1 = new NumericUpDown() { Margin = new Thickness(5,0,0,0) };
            numCount_1.DecimalPlaces = 2;
            numCount_1.Increment = 1;
            numCount_1.Minimum = int.MinValue;
            numCount_1.Maximum = int.MaxValue;
            numCount_1.Value = 0;
            LayoutRoot.Children.Add(numCount_1);
            Grid.SetRow(numCount_1, 1);
            Grid.SetColumn(numCount_1, 2);

            // Текст "и"
            lblAnd = new TextBlock() { Text = Localization.Filter_Label_And, TextAlignment = TextAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom, Margin = new Thickness(5, 0, 0, 0) };
            LayoutRoot.Children.Add(lblAnd);
            Grid.SetColumn(lblAnd, 3);
            Grid.SetRow(lblAnd, 1);

            // Количество записей
            numCount_2 = new NumericUpDown() { Margin = new Thickness(5, 0, 0, 0) };
            numCount_2.DecimalPlaces = 2;
            numCount_2.Increment = 1;
            numCount_2.Minimum = int.MinValue;
            numCount_2.Maximum = int.MaxValue;
            numCount_2.Value = 1;
            LayoutRoot.Children.Add(numCount_2);
            Grid.SetRow(numCount_2, 1);
            Grid.SetColumn(numCount_2, 4);

            this.Content = LayoutRoot;

            Refresh();
        }
Exemple #2
0
        public ValueFilterControl()
        {
            Grid LayoutRoot = new Grid();

            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(2, GridUnitType.Star)
            });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(2, GridUnitType.Star)
            });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());

            LayoutRoot.RowDefinitions.Add(new RowDefinition());
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = new GridLength(24)
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Мера куба
            comboMeasure = new MeasuresCombo()
            {
                Margin = new Thickness(0)
            };
            LayoutRoot.Children.Add(comboMeasure);
            Grid.SetColumn(comboMeasure, 0);
            Grid.SetRow(comboMeasure, 1);

            // Тип фильтра
            comboFilterType = new ValueFilterTypeCombo()
            {
                Margin = new Thickness(5, 0, 0, 0)
            };
            comboFilterType.SelectionChanged += new SelectionChangedEventHandler(comboFilterType_SelectionChanged);
            LayoutRoot.Children.Add(comboFilterType);
            Grid.SetRow(comboFilterType, 1);
            Grid.SetColumn(comboFilterType, 1);

            // Количество записей
            numCount_1 = new NumericUpDown()
            {
                Margin = new Thickness(5, 0, 0, 0)
            };
            numCount_1.DecimalPlaces = 2;
            numCount_1.Increment     = 1;
            numCount_1.Minimum       = int.MinValue;
            numCount_1.Maximum       = int.MaxValue;
            numCount_1.Value         = 0;
            LayoutRoot.Children.Add(numCount_1);
            Grid.SetRow(numCount_1, 1);
            Grid.SetColumn(numCount_1, 2);

            // Текст "и"
            lblAnd = new TextBlock()
            {
                Text = Localization.Filter_Label_And, TextAlignment = TextAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom, Margin = new Thickness(5, 0, 0, 0)
            };
            LayoutRoot.Children.Add(lblAnd);
            Grid.SetColumn(lblAnd, 3);
            Grid.SetRow(lblAnd, 1);

            // Количество записей
            numCount_2 = new NumericUpDown()
            {
                Margin = new Thickness(5, 0, 0, 0)
            };
            numCount_2.DecimalPlaces = 2;
            numCount_2.Increment     = 1;
            numCount_2.Minimum       = int.MinValue;
            numCount_2.Maximum       = int.MaxValue;
            numCount_2.Value         = 1;
            LayoutRoot.Children.Add(numCount_2);
            Grid.SetRow(numCount_2, 1);
            Grid.SetColumn(numCount_2, 4);

            this.Content = LayoutRoot;

            Refresh();
        }
Exemple #3
0
        public TopFilterControl()
        {
            Grid LayoutRoot = new Grid();

            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(2, GridUnitType.Star)
            });

            LayoutRoot.RowDefinitions.Add(new RowDefinition());
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = new GridLength(24)
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Тип фильтра
            comboFilterType = new TopFilterTypeCombo();
            LayoutRoot.Children.Add(comboFilterType);
            Grid.SetRow(comboFilterType, 1);

            // Количество записей
            numCount = new NumericUpDown()
            {
                Margin = new Thickness(5, 0, 0, 0)
            };
            numCount.Minimum   = 0;
            numCount.Increment = 1;
            numCount.Value     = 10;
            LayoutRoot.Children.Add(numCount);
            Grid.SetRow(numCount, 1);

            // Расставляем контролы в зависимости от культуры
            String culture = Thread.CurrentThread.CurrentUICulture.Name.ToLower();

            if (culture == "ru" || culture == "ru-ru")
            {
                // Количество
                numCount.Margin = new Thickness(0);
                Grid.SetColumn(numCount, 0);
                // Тип фильтра
                LayoutRoot.ColumnDefinitions[1].Width = new GridLength(2, GridUnitType.Star);
                comboFilterType.Margin = new Thickness(5, 0, 0, 0);
                Grid.SetColumn(comboFilterType, 1);

                // Что отбираем
                LayoutRoot.ColumnDefinitions[2].Width = new GridLength(3, GridUnitType.Star);
            }
            else
            {
                // Тип фильтра
                LayoutRoot.ColumnDefinitions[0].Width = new GridLength(2, GridUnitType.Star);
                comboFilterType.Margin = new Thickness(0);
                Grid.SetColumn(comboFilterType, 0);
                // Количество
                numCount.Margin = new Thickness(5, 0, 0, 0);
                Grid.SetColumn(numCount, 1);

                // Что отбираем
                LayoutRoot.ColumnDefinitions[2].Width = new GridLength(2, GridUnitType.Star);
            }

            // Что отбираем
            comboFilterTarget = new TopFilterTargetCombo()
            {
                Margin = new Thickness(5, 0, 0, 0)
            };
            LayoutRoot.Children.Add(comboFilterTarget);
            Grid.SetColumn(comboFilterTarget, 2);
            Grid.SetRow(comboFilterTarget, 1);

            // Текст "по"
            TextBlock lblBy = new TextBlock()
            {
                Text = Localization.Filter_Label_By, TextAlignment = TextAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom, Margin = new Thickness(5, 0, 0, 0)
            };

            LayoutRoot.Children.Add(lblBy);
            Grid.SetColumn(lblBy, 3);
            Grid.SetRow(lblBy, 1);

            // Мера куба
            comboMeasure = new MeasuresCombo()
            {
                Margin = new Thickness(5, 0, 0, 0)
            };
            LayoutRoot.Children.Add(comboMeasure);
            Grid.SetColumn(comboMeasure, 4);
            Grid.SetRow(comboMeasure, 1);

            //Width = 500;
            this.Content = LayoutRoot;
        }
        public TopFilterControl()
        {
            Grid LayoutRoot = new Grid();

            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(2, GridUnitType.Star) });

            LayoutRoot.RowDefinitions.Add(new RowDefinition());
            LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(24) });
            LayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Тип фильтра
            comboFilterType = new TopFilterTypeCombo();
            LayoutRoot.Children.Add(comboFilterType);
            Grid.SetRow(comboFilterType, 1);

            // Количество записей
            numCount = new NumericUpDown() { Margin = new Thickness(5,0,0,0) };
            numCount.Minimum = 0;
            numCount.Increment = 1;
            numCount.Value = 10;
            LayoutRoot.Children.Add(numCount);
            Grid.SetRow(numCount, 1);

            // Расставляем контролы в зависимости от культуры
            String culture = Thread.CurrentThread.CurrentUICulture.Name.ToLower();
            if (culture == "ru" || culture == "ru-ru")
            {
                // Количество
                numCount.Margin = new Thickness(0);
                Grid.SetColumn(numCount, 0);
                // Тип фильтра
                LayoutRoot.ColumnDefinitions[1].Width = new GridLength(2, GridUnitType.Star);
                comboFilterType.Margin = new Thickness(5, 0, 0, 0);
                Grid.SetColumn(comboFilterType, 1);

                // Что отбираем
                LayoutRoot.ColumnDefinitions[2].Width = new GridLength(3, GridUnitType.Star);
            }
            else
            {
                // Тип фильтра
                LayoutRoot.ColumnDefinitions[0].Width = new GridLength(2, GridUnitType.Star);
                comboFilterType.Margin = new Thickness(0);
                Grid.SetColumn(comboFilterType, 0);
                // Количество
                numCount.Margin = new Thickness(5, 0, 0, 0);
                Grid.SetColumn(numCount, 1);

                // Что отбираем
                LayoutRoot.ColumnDefinitions[2].Width = new GridLength(2, GridUnitType.Star);
            }

            // Что отбираем
            comboFilterTarget = new TopFilterTargetCombo() { Margin = new Thickness(5, 0, 0, 0) };
            LayoutRoot.Children.Add(comboFilterTarget);
            Grid.SetColumn(comboFilterTarget, 2);
            Grid.SetRow(comboFilterTarget, 1);

            // Текст "по"
            TextBlock lblBy = new TextBlock() { Text = Localization.Filter_Label_By, TextAlignment = TextAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom, Margin = new Thickness(5, 0, 0, 0) };
            LayoutRoot.Children.Add(lblBy);
            Grid.SetColumn(lblBy, 3);
            Grid.SetRow(lblBy, 1);

            // Мера куба
            comboMeasure = new MeasuresCombo() { Margin = new Thickness(5, 0, 0, 0) }; 
            LayoutRoot.Children.Add(comboMeasure);
            Grid.SetColumn(comboMeasure, 4);
            Grid.SetRow(comboMeasure, 1);
            
            //Width = 500;
            this.Content = LayoutRoot;
        }