using InABox.Core; using System; 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; using System.Windows.Media.Imaging; namespace InABox.DynamicGrid { public class DFFieldPlaceholderControl : DynamicFormControl where TField : DFLayoutField { protected override FrameworkElement Create() { var result = new Border(); result.Child = new Label { Content = string.Format("[{0}]", Control.Name), HorizontalContentAlignment = HorizontalAlignment.Center, VerticalContentAlignment = VerticalAlignment.Center, FontWeight = FontWeights.DemiBold }; var code = Control.Name; // GetPropertyValue("Code"); var variable = FormDesignGrid.Variables.FirstOrDefault(x => string.Equals(x.Code, code)); result.Background = variable != null ? new SolidColorBrush(Colors.White) : new SolidColorBrush(Colors.Red); result.BorderBrush = BorderBrush; result.BorderThickness = new Thickness(0.75); return result; } } }