Пример #1
0
        /// <summary>МЕТОД Создание фильтров</summary>
        private void MET_CreateFiltr()
        {
            PART_Grid.RowDefinitions[0].Height = new GridLength(80, GridUnitType.Auto);
            PART_Expander.Visibility           = Visibility.Visible;
            PART_Expander.IsExpanded           = true; // Показываем строку Фильтра
            Border _Border = new Border();

            _Border.Style         = (Style)FindResource("Border_2");
            PART_Expander.Content = _Border;
            StackPanel _SPanel = new StackPanel();

            _Border.Child = _SPanel;
            // ---- Настраиваем 1й фильтр
            StackPanel _SPanel_1 = new StackPanel();

            _SPanel_1.Orientation = Orientation.Horizontal;
            _SPanel_1.Margin      = new Thickness(0, 2, 0, 2);
            _SPanel.Children.Add(_SPanel_1);
            // Check Профильные шаблоны
            PRI_CheckBox_1                   = new CheckBox();
            PRI_CheckBox_1.Margin            = new Thickness(10, 0, 0, 0);
            PRI_CheckBox_1.Content           = "Только Профильные шаблоны";
            PRI_CheckBox_1.VerticalAlignment = VerticalAlignment.Center;
            PRI_CheckBox_1.Foreground        = Brushes.Navy;
            PRI_CheckBox_1.IsChecked         = true;
            PRI_CheckBox_1.Click            += delegate { MET_DopFilter(); };
            _SPanel_1.Children.Add(PRI_CheckBox_1);
            // Check Шаблоны Документов
            PRI_CheckBox_2                   = new CheckBox();
            PRI_CheckBox_2.Margin            = new Thickness(30, 0, 0, 0);
            PRI_CheckBox_2.Content           = "Показать шаблоны Документов";
            PRI_CheckBox_2.VerticalAlignment = VerticalAlignment.Center;
            PRI_CheckBox_2.Foreground        = Brushes.Navy;
            PRI_CheckBox_2.IsChecked         = MySql.MET_QueryBool(MyQuery.MET_ListShablon_Select_1()); // если нету профильных шаблонов, открываем дополнительные документы
            PRI_CheckBox_2.Click            += delegate { MET_DopFilter(); };
            _SPanel_1.Children.Add(PRI_CheckBox_2);
        }