Example #1
0
 private void powerTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (_item == null || !powerTextBox.IsEnabled)
     {
         return;
     }
     if (int.TryParse(powerTextBox.Text, out int level))
     {
         powerTextBox.BorderBrush = Brushes.Gray;
         _item.Power = GameCalculator.powerFromLevel(level);
         this.saveChanges?.Execute(_item);
     }
     else
     {
         powerTextBox.BorderBrush = Brushes.Red;
     }
 }
Example #2
0
 private void powerTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (_item == null || !powerTextBox.IsEnabled)
     {
         return;
     }
     if (int.TryParse(powerTextBox.Text, out int level))
     {
         EventLogger.logEvent("powerTextBox_TextChanged", new Dictionary <string, object>()
         {
             { "level", level }
         });
         powerTextBox.BorderBrush = Brushes.Gray;
         _item.Power = GameCalculator.powerFromLevel(level);
         this.saveChanges?.Execute(_item);
     }
     else
     {
         powerTextBox.BorderBrush = Brushes.Red;
     }
 }