public Day1() { InitializeComponent(); _viewModel = Util.GetDayViewModel(); Util.LoadTextBoxWithInput(_viewModel, InputBox); }
private void ChangeViewModel(DayViewModel viewModel) { if (!DayViewModels.Contains(viewModel)) { DayViewModels.Add(viewModel); } CurrentDayViewModel = DayViewModels .FirstOrDefault(vm => vm == viewModel); }
public static void LoadTextBoxWithInput(DayViewModel viewModel, TextBox inputBox) { inputBox.Clear(); int numberOfLines = viewModel.InputLines.Length; for (int lineIndex = 0; lineIndex < numberOfLines; ++lineIndex) { string line = viewModel.InputLines[lineIndex]; if (lineIndex < numberOfLines - 1) { line += Environment.NewLine; } inputBox.AppendText(line); } }