Esempio n. 1
0
        private void GenerateComboBoxcontrol(Field field)
        {
            TextBox control = new TextBox {
                Width = 0
            };
            ComboBox combobox = new ComboBox
            {
                SelectedValuePath = "Key",
                DisplayMemberPath = "Value",
                ItemsSource       = field.DropDownItems,
                SelectedIndex     = 0
            };

            combobox.SelectionChanged += (o, e) =>
            {
                control.Text = ((ComboBox)o).SelectedValue.ToString();
            };

            Grid.SetColumn(combobox, 1);
            Grid.SetRow(combobox, field.Order - 1);
            Grid.SetColumnSpan(combobox, 2);
            combobox.AddAnimation();
            MainGrid.Children.Add(combobox);

            Grid.SetColumn(control, 1);
            Grid.SetRow(control, field.Order - 1);
            control.AddAnimation();
            MainGrid.Children.Add(control);
        }