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

Closed
wants to merge 13 commits into
base: develop
from

Conversation

Projects
None yet
3 participants
@feinstein
Contributor

feinstein commented Mar 10, 2016

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.

nrpog and others added some commits Feb 18, 2016

Merge pull request #2359 from nrpog/master
Added ContentStringFormat TemplateBinding to ToolTip
Merge pull request #2362 from MahApps/revert-2359-master
Revert "Added ContentStringFormat TemplateBinding to ToolTip"
Merge pull request #2404 from feinstein/Fix-NumericUpDown-HasDecimals
Fixes the HasDecimals property, broken before on commit bd6aa38.
Merge pull request #2405 from MahApps/revert-2404-Fix-NumericUpDown-H…
…asDecimals

Revert "Fixes the HasDecimals property, broken before on commit bd6aa38."
Added the habilitiy to block the use of the scientific notation 'e', …
…using the property HasScientificNotation.

Updated the example as well.
@punker76

This comment has been minimized.

Member

punker76 commented Mar 10, 2016

@xxMUROxx

This comment has been minimized.

Contributor

xxMUROxx commented Mar 10, 2016

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.

This comment has been minimized.

@xxMUROxx

xxMUROxx Mar 10, 2016

Contributor

The comment should be update to match the correct behavior.

@xxMUROxx

This comment has been minimized.

Contributor

xxMUROxx commented Mar 10, 2016

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)

feinstein added some commits Mar 11, 2016

Merge branch 'develop' of https://github.com/MahApps/MahApps.Metro in…
…to Add-NumericUpDown-HasScientificNotation-Property
Merge branch 'master' of https://github.com/MahApps/MahApps.Metro int…
…o Add-NumericUpDown-HasScientificNotation-Property
Merge branch 'develop' of https://github.com/MahApps/MahApps.Metro in…
…to Add-NumericUpDown-HasScientificNotation-Property
@feinstein

This comment has been minimized.

Contributor

feinstein commented Jan 11, 2017

Any decisions on this?

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