This is a migrated thread and some comments may be shown as answers.

NumericBox Increase Decrease Button Styles change button behaviour

2 Answers 45 Views
NumericBox for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Simon
Top achievements
Rank 1
Simon asked on 04 Sep 2013, 07:24 PM

It seems that if I explicitly set style in code that it is overriding and eliminating all other default styles on the control correct?

I am trying to set the following styles, see code below, which does work.  Unfortunately when I do this it seems to change the behavior of the up/down arrows.  If I press and hold the up or down arrow with these styles applied it no longer continuously increase/decreases the number like it did without these styles.  I now have to keep pressing to increase/decrease.  Is there a property I need to set so the continuous increase still works?  If so what would the Setter be?

Thanks
Simon


Style numericUpDownButtonStyle = new Style();
numericUpDownButtonStyle.TargetType = typeof(InlineButton);
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.ForegroundProperty, Value = new SolidColorBrush(Colors.Black) });
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.BackgroundProperty, Value = new SolidColorBrush(Colors.White) });
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.HeightProperty, Value = 41 });
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.WidthProperty, Value = 40 });
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.BorderBrushProperty, Value = this.numericBoxPicker.BorderBrush });
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.BorderThicknessProperty, Value = numericBoxPicker.BorderThickness });
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.PointerOverBackgroundBrushProperty, Value = new SolidColorBrush(Colors.White) });
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.PointerOverBorderBrushProperty, Value = new SolidColorBrush(Colors.Black) });
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.PointerOverForegroundBrushProperty, Value = new SolidColorBrush(Colors.Black) });
 
numericBoxPicker.DecreaseButtonStyle = numericUpDownButtonStyle;
numericBoxPicker.IncreaseButtonStyle = numericUpDownButtonStyle;
 

2 Answers, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 05 Sep 2013, 08:53 AM
Hi Simon,

Thank you for contacting us.

First, I confirm that if you set the style of the InlineButton, you will override its default style.
About the second question - it seems that this is a bug and I have logged it in our bug tracking system. For now, as a workaround, I can suggest you set the InlineButton.IsTabStop property to false.
numericUpDownButtonStyle.Setters.Add(new Setter() { Property = InlineButton.IsTabStopProperty, Value = false });

Let me know if this helps. I have updated your Telerik points because of your valuable feedback.

 

Regards,
Ivaylo Gergov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Simon
Top achievements
Rank 1
answered on 05 Sep 2013, 02:15 PM
Thanks so much Ivaylo, this fixed the issue for me.

Much appreciated.
Simon 
Tags
NumericBox for XAML
Asked by
Simon
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Simon
Top achievements
Rank 1
Share this question
or