public static AppForm NewAppForm(string filePath = null) { AppForm appForm = null; // will assign below Func <Project.File, EditorForm> doOpenFile = null; // will assign below var openEditorController = new OpenEditorController(x => doOpenFile(x)); var projectContentFormViewModel = new ProjectContentFormViewModel(openEditorController); var projectContentForm = new ProjectContentForm(projectContentFormViewModel); var findForm = new SearchResultsForm(); appForm = new AppForm(new AppFormViewModel(filePath), projectContentForm, findForm, out doOpenFile); return(appForm); }
public ProjectContentForm(ProjectContentFormViewModel viewModel) { InitializeComponent(); _ListView.AutoSizeColumnWidths(_NameCol); _ListView.BindItems(viewModel.List); _ListView.BindSelectedItems(viewModel.SelectedList); _ListView.BindItemActivate(viewModel.ItemActivate); _ContextMnu.BindEnabled(viewModel.ContextMenuEnabled); _OpenMnu.BindClick(viewModel.ItemActivate); _RenameMnu.BindEnabled(viewModel.RenameEnabled); _RenameMnu.BindClick(viewModel.RenameClick); _MoveMnu.BindClick(viewModel.MoveClick); _DeleteMnu.BindClick(viewModel.DeleteClick); _DuplicateMnu.BindClick(viewModel.DuplicateClick); viewModel.Start(this); }