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

[WIP] Feature/Fluent ButtonSpinner + NumericUpDown #4109

Closed
wants to merge 7 commits into from
Closed

[WIP] Feature/Fluent ButtonSpinner + NumericUpDown #4109

wants to merge 7 commits into from

Conversation

maxkatz6
Copy link
Member

What does the pull request do?

Button spinner (popup for compact view is not implemented yet in this PR):
image

NumericUpDown:
image

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

@@ -18,10 +18,24 @@ public class MarginMultiplierConverter : IValueConverter

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Copy link
Member Author

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"
Copy link
Member Author

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}" />
Copy link
Member Author

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.

@maxkatz6
Copy link
Member Author

RepeatButton changes could be merged with #4110

@maxkatz6
Copy link
Member Author

Closing this and creating another PR with cherrypicked commits #4118

@maxkatz6 maxkatz6 closed this Jun 14, 2020
@maxkatz6 maxkatz6 deleted the feature/fluent-numericupdown branch June 14, 2020 19:37
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

Successfully merging this pull request may close these issues.

None yet

1 participant