public override object CreateControl()
 {
     control = new MultiListSelectorControl();
     control.Init(Values, Bins);
     control.SelectedIndices = Value;
     return(control);
 }
        private void InitializeComponent()
        {
            _reagents.Clear();
            _mods.Clear();

            int height = _uniqueSamples.Length*Constants.height;

            Grid grid = new Grid();
            grid.RowDefinitions.Add(new RowDefinition{Height = new GridLength(1, GridUnitType.Auto)});
            grid.RowDefinitions.Add(new RowDefinition{Height = new GridLength(1, GridUnitType.Auto)});
            grid.RowDefinitions.Add(new RowDefinition{
                Height = new GridLength(Constants.ListSelectorHeight, GridUnitType.Pixel)
            });
            grid.RowDefinitions.Add(new RowDefinition{Height = new GridLength(height, GridUnitType.Pixel)});

            grid.ColumnDefinitions.Add(new ColumnDefinition{Width = new GridLength(1, GridUnitType.Auto)});
            for (int i = 0; i < _count; i++){
                grid.ColumnDefinitions.Add(new ColumnDefinition{Width = new GridLength(100f/_count, GridUnitType.Star)});
            }

            Label label1 = new Label{
                Content = "quantification",
                HorizontalContentAlignment = HorizontalAlignment.Left,
                VerticalContentAlignment = VerticalAlignment.Top
            };
            Grid.SetRow(label1, 1);
            Grid.SetColumn(label1, 0);
            grid.Children.Add(label1);

            Label label2 = new Label{
                Content = "reagent",
                HorizontalContentAlignment = HorizontalAlignment.Left,
                VerticalContentAlignment = VerticalAlignment.Top
            };
            Grid.SetRow(label2, 2);
            Grid.SetColumn(label2, 0);
            grid.Children.Add(label2);

            Label label3 = new Label{
                Content = "references",
                HorizontalContentAlignment = HorizontalAlignment.Left,
                VerticalContentAlignment = VerticalAlignment.Top
            };
            Grid.SetRow(label3, 3);
            Grid.SetColumn(label3, 0);
            grid.Children.Add(label3);

            for (int n = 0; n < _count; n++){
                Label group = new Label{
                    HorizontalContentAlignment = HorizontalAlignment.Center,
                    VerticalContentAlignment = VerticalAlignment.Top,
                    FontWeight = FontWeights.Bold
                };
                Grid.SetRow(group, 0);
                Grid.SetColumn(group, n + 1);
                grid.Children.Add(group);
                _groups.Add(group);

                Label reagent = new Label{
                    HorizontalContentAlignment = HorizontalAlignment.Center,
                    VerticalContentAlignment = VerticalAlignment.Top
                };
                Grid.SetRow(reagent, 1);
                Grid.SetColumn(reagent, n + 1);
                grid.Children.Add(reagent);
                _reagents.Add(reagent);

                ListSelectorControl mod = new ListSelectorControl();
                foreach (var m in _modifications){
                    mod.Items.Add(m);
                }
                Grid.SetRow(mod, 2);
                Grid.SetColumn(mod, n + 1);
                grid.Children.Add(mod);
                _mods.Add(mod);

                MultiListSelectorControl msrunRef = new MultiListSelectorControl{MinHeight = height - 6};
                msrunRef.Init(_msRunText, _uniqueSamples);
                Grid.SetRow(msrunRef, 3);
                Grid.SetColumn(msrunRef, n + 1);
                grid.Children.Add(msrunRef);
                _msrunRefs.Add(msrunRef);
            }

            Children.Add(grid);
        }
        public StudyVariablePanel2(StudyVariable[] value)
        {
            HorizontalAlignment = HorizontalAlignment.Left;

            _count = value.Length;

            foreach (StudyVariable variable in value){
                if (variable.AssayMap != null){
                    foreach (var assay in variable.AssayMap.Values){
                        if (assay == null){
                            continue;
                        }
                        _assayText.Add(AssayToString(assay));
                        _assayList.Add(assay);
                    }
                }

                if (variable.SampleMap != null){
                    foreach (var sample in variable.SampleMap.Values){
                        if (sample == null){
                            continue;
                        }
                        _sampleText.Add(SampleToString(sample));
                        _sampleList.Add(sample);
                    }
                }
            }

            MaxWidth = 750;
            Width = MaxWidth;

            _sampleRefs = new MultiListSelectorControl{
                MinHeight = _count*Constants.height - 6,
                HorizontalAlignment = HorizontalAlignment.Stretch
            };
            _assayRefs = new MultiListSelectorControl{
                MinHeight = _count*Constants.height - 6,
                HorizontalAlignment = HorizontalAlignment.Stretch
            };

            InitializeComponent();

            Value = value;
        }