private bool ValidarEntradas()
        {
            bool resultado = false;

            if (ServiciosDeValidacion.ValidarCadena(TextBoxCodigo.Text) &&
                ServiciosDeValidacion.ValidarCadena(TextBoxNombre.Text) &&
                ServiciosDeValidacion.ValidarCadena(TextBoxCodigoBarras.Text) &&
                ServiciosDeValidacion.ValidarNumeroDecimal(TextBoxCosto.Text) &&
                ServiciosDeValidacion.ValidarNumeroDecimal(TextBoxCantidad.Text))
            {
                if (CheckBoxIngredienteCompuesto.IsChecked == true)
                {
                    if (Componentes.Count <= 0)
                    {
                        MessageBox.Show("Este ingrediente no tiene componentes.", "Alerta");
                    }
                    else
                    {
                        resultado = true;
                    }
                }
                else
                {
                    resultado = true;
                }
            }

            return(resultado);
        }
 private void TextBoxCantidad_Pasting(object sender, DataObjectPastingEventArgs e)
 {
     if (e.DataObject.GetDataPresent(typeof(string)))
     {
         string entrada = (string)e.DataObject.GetData(typeof(string));
         if (!ServiciosDeValidacion.ValidarNumeroDecimal(entrada))
         {
             e.CancelCommand();
         }
     }
     else
     {
         e.CancelCommand();
     }
 }