[Feature Request] Proposals for input/display improvements and hexadecimal support in NumericUpDown
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start from the UpDownBase.cs base class that the proposed properties (SelectAllOnFocus, DecimalPlaces, Hexadecimal, IsEditable) would extend, and from the Enter-key handling in OnPreviewKeyDown. The hex controls (HexByte through HexUlong) would need new types and default styles. The text-foreground idea touches TextFieldAssist.TextBoxViewForeground. Done would mean maintainers agree which proposals to accept, since the issue is a bundle of design decisions, not one change.
索引モデルが issue の本文から書いたものです。
説明
Description
I often build custom NumericUpDown controls to fit my needs. I have extracted some key features and implemented them for verification. While some parts of my implementation might still be unrefined, I would be grateful if you could check the concepts and consider incorporating these ideas into the library.
- Forked Repository for Verification: https://github.com/sandfox922/MaterialDesignInXamlToolkit/commit/99c68edd0bc9556185119537cc5b8a1be86af835#diff-570b0eeb4aa300fe8219e62b4f8f69accda4b993382d4520111712781c9a85c0
1. Extension / Refactoring Ideas for UpDownBase.cs
SelectAllOnFocus(bool): Automatically selects all text when the text area gains focus.DecimalPlaces(int): Handles rounding and formats the display to a fixed number of decimal places (e.g., keeping trailing zeros), similar to standard WinForms/WPF numeric controls.Hexadecimal(bool, protected): Enables hex mode and relies onDecimalPlacesto define the display digit length (accessible only via inheritance).IsEditable(bool): Toggles the underlyingTextBox.IsReadOnlyproperty to make the text area read-only, allowing value changes only through Up/Down button interactions.- Enter Key Behavior: Updates the numeric value and automatically re-selects all text upon pressing the Enter key.
2. Addition of Hexadecimal (Hex) Support Controls
- Introduce dedicated hex controls:
HexByte,HexShort,HexInt,HexLong,HexUshort,HexUint, andHexUlong. Each control would set its ownDefaultStyleKeyand overrideHexadecimaltotrue.
Background & Detailed Use Cases
① Improving Keyboard/Manual Input Workflow
This is intended for scenarios where users need to repeatedly and quickly modify configuration values using only the keyboard, without relying on mouse interactions:
- Control gains focus -> the entire text is selected (
SelectAllOnFocus). - User types the new number.
- User presses the Enter key to confirm the value (handled via
OnPreviewKeyDown). - Upon confirmation, the text automatically returns to a fully selected state.
- This loop allows for seamless, rapid manual data entry.
- Related Features:
SelectAllOnFocus, Enter key confirmation, and restricting input to numeric keys only.
② Enhancing Numerical Visibility & Reducing Human Error
- Consistent Digit Alignment via
DecimalPlaces:
When entering values like1.23,12.3, or123, a lack of aligned decimal places can easily lead to visual misinterpretation. Formatting them as1.230,12.300, and123.000dramatically reduces caret-skipping and reading mistakes while making significant digits obvious. It also stabilizes the control's layout width during Up/Down stepping. - Targeted Foreground Color for the Numeric Part Only:
Sometimes it is useful to turn negative values red or change colors based on thresholds. Currently, settingForeground="Red"turns everything red, includingPrefixTextandSuffixText.
It would be highly beneficial to have a property likematerialDesign:TextFieldAssist.TextBoxViewForegroundto selectively color just the inner text/value field. (Note: I attempted to implement this locally but couldn't get it working perfectly.) - Restricting Direct Typing via
IsEditable:
Useful when you want to prevent arbitrary user typing and restrict changes solely to the Up/Down buttons for data safety.
Thank you for your time and for maintaining this wonderful library. I hope these ideas can be helpful for future updates!
- 主要言語
- C#
- スター
- 16.3k
- フォーク
- 3.5k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MaterialDesignInXAML/MaterialDesignInXamlToolkit のほかの issue
-
enhancement up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#2485 ·
メンテナーはふだん 1 日以内に返信
-
enhancement evaluation required
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#3997 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug evaluation required
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#3971 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement evaluation required
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#3918 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement evaluation required
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#3903 · コメント 5 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
MaterialDesignInXAML/MaterialDesignInXamlToolkit の issue をすべて見る
似ている issue
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Edit Bar buttons are not localized対応中かも @idumlupinar が今日担当しました。 オープンStatus: New
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
dnnsoftware/Dnn.Platform#7565 ·
メンテナーはふだん 1 日以内に返信
-
AzureBlobSnapshotStore.LoadAsync allocates the snapshot twice (growable MemoryStream + ToArray)オープンenhancement
難易度 2/5 半日 初心者へのやさしさ 72/100
-
bug ui-only
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ClickHouse/clickhouse-cs#689 ·
メンテナーはふだん 2 日以内に返信