public LineListProperties(
            DashboardHelper dashboardHelper, 
            IGadget gadget, 
            LineListParameters parameters, 
            List<Grid> strataGridList,
            List<string> columnOrder
            )
        {
            InitializeComponent();
            this.DashboardHelper = dashboardHelper;
            this.Gadget = gadget;
            this.Parameters = parameters;
            this.StrataGridList = strataGridList;
            this.ColumnOrder = columnOrder;

            List<FieldInfo> items = new List<FieldInfo>();
            List<string> fields = new List<string>();

            foreach (string fieldName in DashboardHelper.GetFieldsAsList())
            {
                items.Add(new FieldInfo()
                {
                    Name = fieldName,
                    DataType = DashboardHelper.GetColumnDbType(fieldName).ToString(),
                    VariableCategory = VariableCategory.Field
                });

                fields.Add(fieldName);
            }

            foreach (string fieldName in DashboardHelper.GetAllGroupsAsList())
            {
                FieldInfo fieldInfo = new FieldInfo()
                {
                    Name = fieldName,
                    DataType = String.Empty,
                    VariableCategory = VariableCategory.Group
                };
                items.Add(fieldInfo);
            }

            if (DashboardHelper.IsUsingEpiProject)
            {
                for (int i = 0; i < DashboardHelper.View.Pages.Count; i++)
                {
                    items.Add(new FieldInfo()
                    {
                        Name = "Page " + (i + 1).ToString(),
                        DataType = String.Empty,
                        VariableCategory = VariableCategory.Page
                    });
                }
            }

            fields.Sort();

            lvVariables.ItemsSource = items;
            cmbGroupField.ItemsSource = fields;
            cmbSecondaryGroupField.ItemsSource = fields;

            foreach (string fieldName in fields)
            {
                lbxAvailableVariables.Items.Add(fieldName);
            }

            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(lvVariables.ItemsSource);
            PropertyGroupDescription groupDescription = new PropertyGroupDescription("VariableCategory");
            view.GroupDescriptions.Add(groupDescription);

            RowFilterControl = new RowFilterControl(this.DashboardHelper, Dialogs.FilterDialogMode.ConditionalMode, (gadget as LineListControl).DataFilters, true);
            RowFilterControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            panelFilters.Children.Add(RowFilterControl);
        }
        public CombinedFrequencyProperties(
            DashboardHelper dashboardHelper, 
            IGadget gadget, 
            IGadgetParameters parameters
            )
        {
            InitializeComponent();
            this.DashboardHelper = dashboardHelper;
            this.Gadget = gadget;
            this.Parameters = (parameters as CombinedFrequencyParameters);

            List<FieldInfo> items = new List<FieldInfo>();
            List<string> fields = new List<string>();

            ColumnDataType columnDataType = ColumnDataType.Boolean | ColumnDataType.Numeric | ColumnDataType.Text | ColumnDataType.UserDefined;
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                items.Add(new FieldInfo()
                {
                    Name = fieldName,
                    DataType = DashboardHelper.GetColumnDbType(fieldName).ToString(),
                    VariableCategory = VariableCategory.Field
                });

                fields.Add(fieldName);
            }

            foreach (string fieldName in DashboardHelper.GetAllGroupsAsList())
            {
                FieldInfo fieldInfo = new FieldInfo()
                {
                    Name = fieldName,
                    DataType = String.Empty,
                    VariableCategory = VariableCategory.Group
                };
                items.Add(fieldInfo);
            }

            if (DashboardHelper.IsUsingEpiProject)
            {
                for (int i = 0; i < DashboardHelper.View.Pages.Count; i++)
                {
                    items.Add(new FieldInfo()
                    {
                        Name = "Page " + (i + 1).ToString(),
                        DataType = String.Empty,
                        VariableCategory = VariableCategory.Page
                    });
                }
            }

            fields.Sort();

            lvGroupVariables.ItemsSource = items;
            //cmbGroupField.ItemsSource = fields;

            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(lvGroupVariables.ItemsSource);
            PropertyGroupDescription groupDescription = new PropertyGroupDescription("VariableCategory");
            view.GroupDescriptions.Add(groupDescription);

            RowFilterControl = new RowFilterControl(this.DashboardHelper, Dialogs.FilterDialogMode.ConditionalMode, (gadget as CombinedFrequencyControl).DataFilters, true);
            RowFilterControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            panelFilters.Children.Add(RowFilterControl);
        }