DFElementPlaceholderControl.cs 988 B

12345678910111213141516171819202122232425262728293031
  1. using InABox.Core;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Media;
  10. namespace InABox.DynamicGrid
  11. {
  12. public class DFElementPlaceholderControl : DynamicFormControl<DFLayoutElement>
  13. {
  14. protected override FrameworkElement Create()
  15. {
  16. var result = new Border();
  17. result.Child = new Label
  18. {
  19. Content = string.Format("[{0}]", Control.Description),
  20. HorizontalContentAlignment = HorizontalAlignment.Center,
  21. VerticalContentAlignment = VerticalAlignment.Center,
  22. FontWeight = FontWeights.DemiBold
  23. };
  24. result.Background = new SolidColorBrush(Colors.Silver);
  25. result.BorderBrush = BorderBrush;
  26. result.BorderThickness = new Thickness(0.75);
  27. return result;
  28. }
  29. }
  30. }