public searchTool() { InitializeComponent(); var viewModel = new searchTool_ModelView(); this.DataContext = viewModel; viewModel.NewToolRequested += (s, a) => { NewTool newToolWindow = new NewTool(); newToolViewModel = newToolWindow.DataContext as NewTool_ViewModel; newToolViewModel.ToolInserted += (so, ar) => { viewModel.selectedTool = so as ToolRepresentation; viewModel.OnToolSelected(); newToolWindow.Close(); }; newToolWindow.Show(); }; }
public NewTool() { InitializeComponent(); var viewModel = new NewTool_ViewModel(); this.DataContext = viewModel; }