private void Window_Closing(object sender, CancelEventArgs e) { TextName.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TextDescricao.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TextVagas.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TextBolsa.GetBindingExpression(TextBox.TextProperty).UpdateSource(); //ListBoxDestino.GetBindingExpression(ListBox.SelectedItemProperty).UpdateSource(); //ListBoxEntidade.GetBindingExpression(ListBox.SelectedItemProperty).UpdateSource(); StartDate.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource(); EndDate.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource(); TextVagas.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TextBolsa.GetBindingExpression(TextBox.TextProperty).UpdateSource(); string message; if (this.DialogResult == true && FormHasErrors(out message)) { // Errors still exist. MessageBox.Show(message); e.Cancel = true; } }
private void LimparTela() { TextNomeProduto.Clear(); TextGrupoCadastro.Clear(); TextDescricao.Clear(); TextPrecoVenda.Clear(); TextPrecoCusto.Clear(); TextEstoque.Clear(); TextNCM.Clear(); TextLocalizacao.Clear(); TextCodigoB.Clear(); }