private void AddNewTask() { //By setting Owner it maintains the UI Automation tree, normally this would be done by a service so the VM doesnt reference the view var dialog = new NewTaskWindow(repo) { Owner = Owner }; if (dialog.ShowDialog() != true) return; Refresh(); }