public static BoxWidget <TextInputWidget> Text(TextInputWidget widget) { var box = widget.Box(); box.Border = BorderStyle.SingleLine; box.Style = new Style(); box.Style.Foreground = Color.Black; widget.Decoration = (state, w) => { if (state.IsEnabled && state.IsFocused) { box.Style.Background = Color.White; } else if (state.IsEnabled) { box.Style.Background = Color.Silver; } else { box.Style.Background = Color.DarkGray; } return(w); }; return(box); }