DFElementPlaceholderControl.cs 974 B

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