private void txtBoxPeso_SelectionChanged(object sender, RoutedEventArgs e) { if (ValidarComponentes.ValidarTextBox(txtBoxPeso, 2) && ValidarComponentes.ValidarTextBox(txtBoxAltura, 2)) { pesoMaxSaudavel = (float)(float.Parse(txtBoxAltura.Text) * float.Parse(txtBoxAltura.Text) * 24.9); lblValorPesoMaximoSaudavel.Text = string.Format("{0:f2}", pesoMaxSaudavel); } }
private void ApplicationBarIconButton_Click(object sender, EventArgs e) { if (ValidarComponentes.ValidarTextBox(txtNomeApelido, 1)) { App.Current.Actives.ActiveAvatarP = AvatarViewModel.BuscarporID(1); App.Current.Actives.ActiveAvatarP.Name = txtNomeApelido.Text; App.Current.Actives.ActiveAvatarP.Alterar(); NavigationService.Navigate(new Uri("/View/FrmCadastroPerfilPasso01.xaml", UriKind.Relative)); } else { MessageBox.Show("Insira o nome de apelido, por favor", "Erro de preenchimento!", MessageBoxButton.OK); } }
private void ApplicationBarIconButton_Click(object sender, EventArgs e) { if (ValidarComponentes.ValidarTextBox(txtBoxPeso, 1) && ValidarComponentes.ValidarTextBox(txtBoxAltura, 1)) { App thisApp = Application.Current as App; thisApp.Actives.ActivePerfil = new PerfilView() { Altura = float.Parse(txtBoxAltura.Text), Peso = float.Parse(txtBoxPeso.Text) }; NavigationService.Navigate(new Uri("/View/FrmCadastroPerfilPasso02.xaml", UriKind.Relative)); } else { ValidarComponentes.msgValidacao1(); } }