12345678910111213141516171819202122232425262728293031323334 |
- using InABox.Core;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Media;
- namespace InABox.DynamicGrid
- {
- public class DFElementControl : DynamicFormControl<DFLayoutElement>
- {
- protected override FrameworkElement Create()
- {
- var element = FormDesignGrid.CreateElement(Control);
- if (element != null)
- return element;
- var result = new Border();
- result.Child = new Label
- {
- Content = string.Format("[{0}]", Control.Description),
- HorizontalContentAlignment = HorizontalAlignment.Center,
- VerticalContentAlignment = VerticalAlignment.Center,
- FontWeight = FontWeights.DemiBold
- };
- result.Background = new SolidColorBrush(Colors.Silver);
- result.BorderBrush = BorderBrush;
- result.BorderThickness = new Thickness(0.75);
- return result;
- }
- }
- }
|