static IControl Create <T>( IAttribute <T> attribute, IProperty <object> objectValue, IObservable <IEnumerable <object> > objectValues, IEditorFactory editors, Text placeholderText = default(Text)) { var stroke = Theme.FieldStroke; var arrowBrush = attribute.IsReadOnly.Select(ro => ro ? Theme.FieldStroke.Brush : Theme.Active).Switch(); return(Layout.Dock() .Right(editors.ExpressionButton(attribute)) .Fill(DropDown.Create(objectValue, objectValues, nativeLook: false) .WithOverlay( Layout.Dock() .Right(Arrow .WithoutShaft(RectangleEdge.Bottom, SymbolSize.Small, arrowBrush) .Center().WithWidth(21) .WithBackground(Theme.PanelBackground)) .Right(Separator.Line(stroke)) .Fill(TextBox.Create( attribute.StringValue, foregroundColor: Theme.DefaultText) .WithPlaceholderText(attribute.HasLocalValue(), placeholderText) .WithBackground(Theme.FieldBackground)) .WithPadding(new Thickness <Points>(1)) .WithOverlay(Shapes.Rectangle(stroke: stroke))) .WithHeight(CellLayout.DefaultCellHeight) .WithWidth(CellLayout.FullCellWidth))); }
public static IControl Create(IAttribute <Color> property, IEditorFactory editors) { return(Layout.Dock() .Right(editors.ExpressionButton(property)) .Fill( Layout.Dock() .Left(CreateWell(property)) .Left(Separator.Line(Theme.FieldStroke)) .Fill(TextBox.Create( property.StringValue, foregroundColor: Theme.DefaultText) .WithPlaceholderText(property.HasLocalValue()) .WithBackground(Theme.FieldBackground)) .WithPadding(new Thickness <Points>(1)) .WithOverlay(Shapes.Rectangle(Theme.FieldStroke)) .WithWidth(CellLayout.FullCellWidth) .WithHeight(CellLayout.DefaultCellHeight))); }