コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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();
     }
 }