public FrameworkElement GenerateControl(Element element)
        {
            var stackPanel = new StackPanel {
                Orientation = Orientation.Horizontal
            };

            stackPanel.Children.Add(HelperElementGenerator.GenerateLabelForElement(element));
            stackPanel.Children.Add(GenerateComboBox(element as ChoiceElement));
            stackPanel.Children.Add(HelperElementGenerator.GenerateExtraTextBox(element));

            return(stackPanel);
        }
        public FrameworkElement GenerateControl(Element element)
        {
            MaskedElement maskedElement = element as MaskedElement;

            StackPanel stackPanel = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            stackPanel.Children.Add(HelperElementGenerator.GenerateLabelForElement(maskedElement));
            stackPanel.Children.Add(GenerateMaskedTextBox(maskedElement));
            stackPanel.Children.Add(HelperElementGenerator.GenerateExtraTextBox(maskedElement));
            return(stackPanel);
        }
コード例 #3
0
        public FrameworkElement GenerateControl(Element element)
        {
            var booleanElement = element as BooleanElement;

            StackPanel stackPanel = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            var checkBox = new CheckBox()
            {
                Margin = new Thickness(10, 0, 0, 0)
            };

            checkBox.DataContext = booleanElement;
            checkBox.SetBinding(ContentControl.ContentProperty, new Binding("Name"));
            checkBox.SetBinding(ToggleButton.IsCheckedProperty, new Binding("Value"));

            stackPanel.Children.Add(checkBox);
            stackPanel.Children.Add(HelperElementGenerator.GenerateExtraTextBox(element));

            return(stackPanel);
        }