public FrameworkElement GenerateControl(Element element)
        {
            var labResultElement = element as LabResultElement;

            var stackPanel = HelperElementGenerator.GenerateElementStackPanel(labResultElement, Orientation.Horizontal);

            TextBox textBox = new TextBox();

            textBox.DataContext = labResultElement;
            textBox.SetBinding(TextBox.TextProperty, new Binding("Value")
            {
                Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            textBox.Height   = 25;
            textBox.MinWidth = 50;
            stackPanel.Children.Add(textBox);

            Label unitsLabel = new Label();

            unitsLabel.Content = labResultElement.Units;
            stackPanel.Children.Add(unitsLabel);

            Label rangeLabel = new Label();

            rangeLabel.Content = $"({labResultElement.LowValue} {labResultElement.Units} - {labResultElement.HighValue} {labResultElement.Units})";
            stackPanel.Children.Add(rangeLabel);

            return(stackPanel);
        }
        public FrameworkElement GenerateControl(Element element)
        {
            var stringElement = element as StringElement;

            var stackPanel = HelperElementGenerator.GenerateElementStackPanel(stringElement, Orientation.Vertical);

            var textBox = GenerateTextbox(stringElement);

            if (stringElement.Complex)
            {
                MakeComplex(textBox);
            }
            else
            {
                textBox.Height = 25;
            }

            stackPanel.Children.Add(textBox);
            return(stackPanel);
        }
        public FrameworkElement GenerateControl(Element element)
        {
            var listElement = element as ListElement;

            var stackPanel = HelperElementGenerator.GenerateElementStackPanel(listElement, Orientation.Vertical);

            var textBox = new TextBox
            {
                DataContext   = listElement,
                TextWrapping  = TextWrapping.Wrap,
                AcceptsReturn = true
            };

            textBox.SpellCheck.IsEnabled = true;
            textBox.HorizontalAlignment  = HorizontalAlignment.Stretch;
            textBox.SetBinding(TextBox.TextProperty, new Binding("ListText")
            {
                Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            textBox.MinHeight = 25;
            stackPanel.Children.Add(textBox);

            return(stackPanel);
        }