Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the habilitiy to block the use of the scientific notation 'e'. #2423

Conversation

feinstein
Copy link
Contributor

What changed?

Added the habilitiy to block the use of the scientific notation 'e', using the property HasScientificNotation. Updated the example as well.

closes #2422.

@punker76
Copy link
Member

^ @xxMUROxx @thoemmi ?

@michaelmairegger
Copy link
Contributor

I would rename the DP from HasScientificNotation to a name that is more saying what the property does. For my understanding the property should---if set to false---remove all e values.
What the DP acually does is "allow/disallow the user to press e".

I would suggest to change HasScientificNotation to AllowsScientificNotation

The same issue is with HasDecimals

If we do not change the name of the DPs I would suggest to update the XML doc to indicate that setting this properties allows/dissalows the user to write specific chars

But this is a suggestion. Keep free to comment.

@@ -463,6 +469,18 @@ public bool HasDecimals
set { SetValue(HasDecimalsProperty, value); }
}

/// <summary>
/// Indicates if the NumericUpDown should show the decimal separator or not.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment should be update to match the correct behavior.

@michaelmairegger
Copy link
Contributor

In addition we could introduce a DP that can be set by an enum:

NumericInputMode of type NumericInput

[Flags]
public enum NumericInput
{
  NumbersOnly = 1 << 1,
  NumbersDecimal = 2 << 1,
  NumbersHex = 3 << 1,
  All = NumbersDecimal | NumbersHex
}

That would give us the benefit of adding additional behaviors if requested in the future.

Then we should remove the other two existing DP (breaking change)

…to Add-NumericUpDown-HasScientificNotation-Property
…o Add-NumericUpDown-HasScientificNotation-Property
…to Add-NumericUpDown-HasScientificNotation-Property
@feinstein
Copy link
Contributor Author

Any decisions on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Added the habilitiy to block the use of the scientific notation 'e' on NumericUpDown.
3 participants