public static MvcHtmlString CustomTextBoxWithButton(this HtmlHelper htmlHelper, string id, string label, string dataBindingValue, int col = 6, bool required = false, int length = Int32.MaxValue, bool isReadonly = false, string cssClass = "k-input", object htmlAttribute = null, string placeHolderText = "", string buttonFunctionName = "", string buttonFunctionText = "") { var attribute = new RouteValueDictionary(); if (htmlAttribute != null) { attribute = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttribute); } attribute.Add("id", id); var viewModel = new InputTextViewModel { Id = id, Label = label, HtmlAttributes = attribute, Required = required, Class = cssClass, DataBindingValue = dataBindingValue, Length = length, ReadOnly = isReadonly, PlaceHolderText = placeHolderText, TextboxType = "type=text", Col = col, ButtonFunctionName = buttonFunctionName, ButtonFunctionText = buttonFunctionText }; return(htmlHelper.Partial("~/Views/Shared/Input/InputTextWithButton.cshtml", viewModel)); }
public InputTextWindow() { InitializeComponent(); ViewModel = new InputTextViewModel(); this.DataContext = ViewModel; txtInput.Focus(); }
public InputTextWindow(string windowTitle, string prompt) { InitializeComponent(); ViewModel = new InputTextViewModel() { WindowTitle = windowTitle, Message = prompt }; this.DataContext = ViewModel; txtInput.Focus(); }
public string GetUserTextInput(string header, string question, string initialResponse = "", bool isMultiline = true) { dynamic settings = new ExpandoObject(); settings.WindowStyle = WindowStyle.ToolWindow; settings.ShowInTaskbar = false; settings.Title = header; settings.ResizeMode = ResizeMode.NoResize; var vm = new InputTextViewModel(header, question, initialResponse, isMultiline); if (_windowManager.ShowDialog(vm, null, settings)) { return(vm.Response); } return(null); }
public static MvcHtmlString CustomTextBox(this HtmlHelper htmlHelper, string id, string label, string dataBindingValue, int col = 6, bool required = false, int length = Int32.MaxValue, bool isReadonly = false, string cssClass = "k-input", object htmlAttribute = null, string placeHolderText = "", bool isPasswordType = false, bool isDisabled = false, string moreClass = "", string autoComplete = "on") { var attribute = new RouteValueDictionary(); if (htmlAttribute != null) { attribute = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttribute); } attribute.Add("id", id); var viewModel = new InputTextViewModel { Id = id, Label = label, HtmlAttributes = attribute, Required = required, Class = cssClass, DataBindingValue = dataBindingValue, Length = length, ReadOnly = isReadonly, PlaceHolderText = placeHolderText, TextboxType = isPasswordType ? "type=password" : "type=text", Col = col, IsDisabled = isDisabled, MoreClass = moreClass, AutoComplete = autoComplete }; if (isPasswordType) { //viewModel.Class += " k-textbox"; } return(htmlHelper.Partial("~/Views/Shared/Input/InputText.cshtml", viewModel)); }