public void ValidateRow(DevExpress.Mvvm.Xpf.RowValidationArgs args)
 {
     using (var unitOfWork = new DevExpress.Xpo.UnitOfWork()) {
         var item = args.IsNewItem
             ? new XPOIssues.Issues.Issue(unitOfWork)
             : unitOfWork.GetObjectByKey <XPOIssues.Issues.Issue>(DetachedObjectsHelper.GetKey(args.Item));
         DetachedObjectsHelper.ApplyProperties(item, args.Item);
         unitOfWork.CommitChanges();
         if (args.IsNewItem)
         {
             DetachedObjectsHelper.SetKey(args.Item, item.Oid);
         }
     }
 }
Example #2
0
 void OnValidateRow(System.Object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
 {
     using (var unitOfWork = new DevExpress.Xpo.UnitOfWork()) {
         var item = e.IsNewItem
             ? new XPOIssues.Issues.Issue(unitOfWork)
             : unitOfWork.GetObjectByKey <XPOIssues.Issues.Issue>(_DetachedObjectsHelper.GetKey(e.Row));
         _DetachedObjectsHelper.ApplyProperties(item, e.Row);
         unitOfWork.CommitChanges();
         if (e.IsNewItem)
         {
             _DetachedObjectsHelper.SetKey(e.Row, item.Oid);
         }
     }
 }