private void RemovePopup()
 {
     if (pup != null)
     {
         GridCurCosts.Children.Remove(pup);
         pup = null;
     }
 }
        private void AllCosts_ItemClick(object sender, ItemClickEventArgs e)
        {
            Cost c = e.ClickedItem as Cost;

            pup             = new DetailPopup(c, s);
            pup.ClosePopup += Pup_ClosePopup;
            pup.EditCost   += Pup_EditCost;
            pup.DeleteCost += Pup_DeleteCost;

            Grid.SetRowSpan(pup, 3);
            Grid.SetColumnSpan(pup, 2);
            GridCurCosts.Children.Add(pup);
        }