Example #1
0
        private void createPicklistMapControl(string user_dc, string pl_content, ref Grid grid)
        {
            PickListMapControl plmc = new PickListMapControl(pl_content);

            plmc.select += value => setMapping(value[0], value[1]);

            string tbx_dc = mapping.getTBXContentMap(user_dc)?.Get(pl_content);

            if (tbx_dc == null)
            {
                tbx_dc = mapping.getTBXMappingList(user_dc)[0];
                mapping.getTBXContentMap(user_dc).Add(pl_content, tbx_dc);
            }

            string tbx_selected = mapping.getPicklistMapValue(user_dc, pl_content);

            fillTBXComboBox(ref plmc.combo_tbx_picklist, mapping.getTBXContentMap(user_dc)?.Get(pl_content), tbx_selected);

            grid.Children.Add(plmc);

            RowDefinition rd = new RowDefinition();

            rd.Height = new GridLength(30);
            grid.RowDefinitions.Add(rd);

            plmc.SetValue(Grid.RowProperty, grid.RowDefinitions.Count - 1);
        }