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
[WIP] Feature/Fluent ButtonSpinner + NumericUpDown #4109
Conversation
@@ -18,10 +18,24 @@ public class MarginMultiplierConverter : IValueConverter | |||
|
|||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect this class to be called "ThicknessMultiplierConverter", but it is public...
BorderBrush="{TemplateBinding BorderBrush}" | ||
Background="Transparent" | ||
BorderBrush="Transparent" | ||
Margin="-2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some hacks required to embed TextBox inside of ButtonSpinner and make all borders with corners looks good. But with NumericUpDown.BorderThickness changing everything will fail...
I would like to reimplement NumericUpDown in same way as NumberBox is done in WinUI. But it will produce code duplication with ButtonSpinner.
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> | ||
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> | ||
<Setter Property="Padding" Value="4"/> | ||
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WinUI uses for NumberBox global resources, not specific for NumberBox ones, so it potentially more difficult to restyle. I will create named resources NumericUpDown for background/foreground/border... with those values as default.
RepeatButton changes could be merged with #4110 |
Closing this and creating another PR with cherrypicked commits #4118 |
What does the pull request do?
Button spinner (popup for compact view is not implemented yet in this PR):
NumericUpDown:
How was the solution implemented (if it's not obvious)?
As reference I used NumberBox from WinUI. But problem is that NumberBox is solid control, when NumericUpDown uses ButtonSpinner. So it just looks similar from some point, but can't be same.
Still WIP.
Breaking changes
Not yet. But we probably need to replace AllowSpin property with SpinButtonPlacementMode. Or just Compact and Inline values and leave AllowSpin for "Hide". But it also requires backport to default style.
@grokys @danwalmsley