private DataTemplate CreateTextBoxTemplate(Style textBoxStyle
                                                   , FormTextGroup formTextGroup)
        {
            var binding = formTextGroup.Binding as Binding;
            var factory = new FrameworkElementFactory(typeof(TextBox));

            if (textBoxStyle != null)
            {
                factory.SetValue(TextBox.StyleProperty, textBoxStyle);
            }
            BindingUtils.BindingPropertyIfNonDefault(factory, TextBox.VerticalContentAlignmentProperty, formTextGroup, FormTextGroup.VerticalContentAlignmentProperty);
            BindingUtils.BindingPropertyIfNonDefault(factory, TextBox.PaddingProperty, formTextGroup, FormTextGroup.PaddingProperty);
            if (binding != null && binding.Source == null && string.IsNullOrEmpty(binding.ElementName))
            {
                ((Binding)binding).Source = DataContext;
                factory.SetBinding(TextBox.TextProperty, binding);
            }
            return(new DataTemplate()
            {
                VisualTree = factory,
            });
        }