public EditProjectVM(ProjectService projectService) { ProjectService = projectService; ProjectNameInputBoxVM = new InputBoxVM() { InputText = ProjectService.CurrentlyOpenedProject.Name, HasErrorMessage = true, ErrorMessage = ERROR_MESSAGE_CANNOT_BE_EMPTY }; ProjectSummaryInputBoxVM = new LargeInputBoxVM() { InputText = ProjectService.CurrentlyOpenedProject.Summary, HasErrorMessage = true, ErrorMessage = ERROR_MESSAGE_CANNOT_BE_EMPTY }; CustomerNameInputBoxVM = new InputBoxVM() { InputText = ProjectService.CurrentlyOpenedProject.CustomerName, HasErrorMessage = true, ErrorMessage = ERROR_MESSAGE_CANNOT_BE_EMPTY }; EmailInputBoxVM = new InputBoxVM() { InputText = ProjectService.CurrentlyOpenedProject.CustomerEmail, HasErrorMessage = true, ErrorMessage = ERROR_MESSAGE_CANNOT_BE_EMPTY }; RegisterEvents(); }
public InputBoxView(string message, string defaultInput = "", string waterMark = "", MessageBoxButtons buttons = MessageBoxButtons.Ok | MessageBoxButtons.Cancel, string?title = null) { DataContext = new InputBoxVM(); ((InputBoxVM)DataContext).host = this; ((InputBoxVM)DataContext).Message = message; ((InputBoxVM)DataContext).Input = defaultInput; ((InputBoxVM)DataContext).WaterMark = waterMark; if (!string.IsNullOrEmpty(title)) { ((InputBoxVM)DataContext).Title = title; } ((InputBoxVM)DataContext).HasCancelButton = (buttons & MessageBoxButtons.Cancel) != 0; ((InputBoxVM)DataContext).HasNoButton = (buttons & MessageBoxButtons.No) != 0; ((InputBoxVM)DataContext).HasOKButton = (buttons & MessageBoxButtons.Ok) != 0; ((InputBoxVM)DataContext).HasYesButton = (buttons & MessageBoxButtons.Yes) != 0; InitializeComponent(); var textBox = this.FindControl <TextBox>("TextBoxInput"); if (textBox != null) { textBox.AttachedToVisualTree += (s, e) => { textBox.Focus(); textBox.SelectAll(); }; } }
public DeleteProjectVM(ProjectService projectService) { ProjectNameInputBoxVM = new InputBoxVM() { PlaceHolderText = "Name of project to be deleted" }; ProjectService = projectService; RegisterEvents(); }
public CreateProjectVM( InputBoxVM projectNameVM, LargeInputBoxVM projectSummaryInputBoxVM, InputBoxVM customerNameInputBoxVM, InputBoxVM emailInputBoxVM) { ProjectNameInputBoxVM = projectNameVM; ProjectSummaryInputBoxVM = projectSummaryInputBoxVM; CustomerNameInputBoxVM = customerNameInputBoxVM; EmailInputBoxVM = emailInputBoxVM; RegisterEvents(); }
public TagVM( InputBoxVM desiredTagNameInputBox, TagsService tagService, ProjectService projectService) { DesiredTagNameInputBox = desiredTagNameInputBox; DesiredTagNameInputBox.PlaceHolderText = "MyTag"; DesiredTagNameInputBox.HasWhiteSpace = false; DesiredTagNameInputBox.HasErrorMessage = true; DesiredTagNameInputBox.ErrorMessage = "Tag name already exist"; TagsService = tagService; ProjectService = projectService; RegisterEvents(); }