void OnAddWorkItem (object sender, EventArgs e)
 {
     using (var selectWorkItemDialog = new SelectWorkItemDialog())
     {
         selectWorkItemDialog.WorkItemList.OnSelectWorkItem += (workItem) =>
         {
             if (IsWorkItemAdded(workItem.Id))
                 return;
             string title = string.Empty;
             if (workItem.WorkItemInfo.ContainsKey("System.Title"))
             {
                 title = Convert.ToString(workItem.WorkItemInfo["System.Title"]);
             }
             var row = workItemsStore.AddRow();
             workItemsStore.SetValue(row, workItemField, workItem);
             workItemsStore.SetValue(row, idField, workItem.Id);
             workItemsStore.SetValue(row, titleField, title);
         };
         selectWorkItemDialog.Run(Xwt.Toolkit.CurrentEngine.WrapWindow(MessageService.RootWindow));
     }
 }
 void OnAddWorkItem(object sender, EventArgs e)
 {
     using (var selectWorkItemDialog = new SelectWorkItemDialog())
     {
         selectWorkItemDialog.WorkItemList.OnSelectWorkItem += (workItem) =>
         {
             if (IsWorkItemAdded(workItem.Id))
                 return;
             string title = string.Empty;
             if (workItem.WorkItemInfo.ContainsKey("System.Title"))
             {
                 title = Convert.ToString(workItem.WorkItemInfo["System.Title"]);
             }
             workItemStore.AppendValues(workItem.Id, title, "Associate");
             removeButton.Sensitive = true;
         };
         selectWorkItemDialog.WorkItemList.OnRemoveWorkItem += (workItem) => 
         {
             if (!IsWorkItemAdded(workItem.Id))
                 return;
             RemoveWorkItem(workItem.Id);
         };
         selectWorkItemDialog.Run(Xwt.Toolkit.CurrentEngine.WrapWindow(MessageService.RootWindow));
     }
 }