private void ClickeableItemButton_Click(object sender, RoutedEventArgs e)
 {
     var t = (int)((Button)sender).DataContext;
     ProductGroup pgroup = BusinessContext.Instance.Model.ProductGroups.First(pg => pg.Code == t);
     var pgd = new ProductGroupDetailViewModel(pgroup);
     Terminal.Instance.Client.ShowDialog(pgd.View,null, (o) => { if(o)ProductDetailViewModel.Product.ProductGroup = pgd.CurrentProductGroup; });
 }
 private void groupBtn_Click(object sender, RoutedEventArgs e)
 {
     var pgd = new ProductGroupDetailViewModel();
     bool? res = ZeroMessageBox.Show(pgd.View, Properties.Resources.NewGroup);
     if (res.HasValue && res.Value)
     {
         groupBox.Items.Add(pgd.CurrentProductGroup);
         ProductDetailViewModel.Product.ProductGroup = pgd.CurrentProductGroup;
     }
 }