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

Support non-integer entries for Number Picker #34

Open
BinaryAssault opened this issue Oct 5, 2024 · 0 comments
Open

Support non-integer entries for Number Picker #34

BinaryAssault opened this issue Oct 5, 2024 · 0 comments

Comments

@BinaryAssault
Copy link

Summary

The number picker currently only supports an integer. This limits the use case for decimal point numbers, say temperatures, money etc. Changing to a double allows for further versatility.

API Changes

Changes to SettingsView/Cells/NumberPickerCell.cs seems to be simple enough swapping int for double in the code.

 public static BindableProperty NumberProperty =
        BindableProperty.Create(
            nameof(Number),
            typeof(int?),
            typeof(NumberPickerCell),
            null,
            defaultBindingMode: BindingMode.TwoWay
        );

To

 public static BindableProperty NumberProperty =
        BindableProperty.Create(
            nameof(Number),
            typeof(double?),
            typeof(NumberPickerCell),
            null,
            defaultBindingMode: BindingMode.TwoWay
        );

etc

Intended Use Case

Would allow more versatility in the NumberPicker control without having to write a CustomCell anytime a double needed to be used for a NumberPicker

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

No branches or pull requests

1 participant