public void activeElements() { try { if (paymentSection.InvoiceId > 0) { paymentSection.mainGrid.IsEnabled = true; paymentManagerImpl.loadedUI(); } else { paymentSection.mainGrid.IsEnabled = false; paymentManagerImpl.unloadAllItems(); } } catch (Exception) { } }