private void OnChangeBuildTemplate()
        {
            try
            {
                var items = this.view.SelectedItems.ToList();
                var teamProjects = items.Select(i => i.TeamProject).Distinct();
                IEnumerable<IProcessTemplate> buildTemplates;
                using (new WaitCursor())
                {
                    buildTemplates = this.repository.GetBuildProcessTemplates(teamProjects);
                }

                var viewModel = new BuildTemplateListViewModel(buildTemplates);
                var wnd = new SelectBuildProcessTemplateWindow(viewModel);
                bool? res = wnd.ShowDialog();
                if (res.HasValue && res.Value)
                {
                    using (new WaitCursor())
                    {
                        this.repository.AssignBuildProcessTemplate(items.Select(bd => bd.Uri), wnd.SelectedBuildTemplate.ServerPath);
                        this.OnRefresh(new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                this.view.DisplayError(ex);
            }
        }
 public SelectBuildProcessTemplateWindow(BuildTemplateListViewModel model)
 {
     this.model = model;
     this.InitializeComponent();
     this.Grid1.DataContext = this.model;
 }