void CurrentObjViewModel_ObjUpdated(object sender, Support.ServiceEventArgs e)
 {
     if (!e.IsNew)
     {
         Service obj = _OC.Where(item => item.EntityKey == e.Servicios.EntityKey).FirstOrDefault();
         if (obj != null)
         {
             //car.Code = e.Car.Code;
             //obj.Subject = e.Tickets.Subject;
             //obj.Body = e.Tickets.Body;
             //obj.DepartmentID = e.Tickets.DepartmentID;
             //obj.PriorityID = e.Tickets.PriorityID;
             //obj.RowID = e.Tickets.RowID;
             //obj.ModifiedDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss.fff"));
             //obj.LastUpdate = Convert.ToDateTime(DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff"));
             //obj.RowID = Guid.NewGuid();
             //DateTime.ParseExact(DateTime.Now.ToString(), "yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture);
             //DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
             //car.Color = e.Car.Color;
             //car.Year = e.Car.Year;
             //car.RentalPrice = e.Car.RentalPrice;
             //this.tb
             //   MessageBox.Show("CurrentObjViewModel_ObjUpdated if");
         }
     }
     else
     {
         _OC.Add(e.Servicios);
     }
     CurrentObjectViewModel = null;
     //  MessageBox.Show("CurrentObjViewModel_ObjUpdated else");
     // OnViewLoaded();
 }
 void OnDetailObjectCommand(Service obj)
 {
     if (obj != null)
     {
         CurrentObjectViewModel                = new EditCatalogServicesViewModel(_ServiceFactory, obj);
         CurrentObjectViewModel.ObjUpdated    += CurrentObjViewModel_ObjUpdated;
         CurrentObjectViewModel.CancelEditObj += CurrentCarViewModel_CancelEditCar;
         // MessageBox.Show("OnEditObjectCommand");
     }
 }
        void OnNewObjectCommand(object arg)
        {
            // System.Windows.MessageBox.Show("false");
            this.buttonNewIsEnabled = false;
            Service obj = new Service();

            CurrentObjectViewModel                = new EditCatalogServicesViewModel(_ServiceFactory, obj);
            CurrentObjectViewModel.ObjUpdated    += CurrentObjViewModel_ObjUpdated;
            CurrentObjectViewModel.CancelEditObj += CurrentCarViewModel_CancelEditCar;


            // MessageBox.Show("OnNewObjectCommand");
        }
 void CurrentCarViewModel_CancelEditCar(object sender, EventArgs e)
 {
     CurrentObjectViewModel  = null;
     this.buttonNewIsEnabled = true;
 }