Posted 7 years ago by Kasper
Version: 11.2.0554
Avatar

Hi guys,

I would like to have a control much like your Int32EditBox but where I have more control. With Snoop I can see that you're using two RepeatButtons, so I thought I would try to do the same. Unfortunately, they are not themed like the RepeatButtons you use in your editor. What will I have to do to get them looking as great as yours, with the non-rounded borders and so on? Is there a style I can re-use or what? I want them looking like yours, while still using the active theme :)

[Modified 7 years ago]

Comments (6)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kasper,

There is a separate control you can use called Spinner, which is part of our Editors for WPF product. So you can simply include that in your custom control. There is a QuickStart that shows the Spinner in action as well.


Actipro Software Support

Posted 7 years ago by Kasper
Avatar

I actually tried that already, but I felt it would give me more control if I used the buttons directly, also because I wasn't quite sure how to handle the commands for the spinner properly. I need it for several controls in a grid-like structure, so I'm not really sure how to handle the Spinner commands individually - perhaps you can give me an example of this? I have a class that wraps around the TextBox and Spinner control, but where and how do I handle the commands?

For future reference and out of curiosity, I would still like to know if my initial question is possible :)

[Modified 7 years ago]

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kasper,

The Spinner Feature QuickStart shows how you can handle the routed commands. But you would probably want to wrap the TextBox and Spinner into a custom templated Control or a UserControl to keep in encapsulated.

The Spinner's buttons use our "embedded" button style, so you can apply it using something like:

xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes"

<RepeatButton Style="{DynamicResource {x:Static themes:SharedResourceKeys.EmbeddedButtonBaseOverrideStyleKey}}" Content="Test" />


Actipro Software Support

Posted 7 years ago by Kasper
Avatar

Hi,

>The Spinner Feature QuickStart shows how you can handle the routed commands. But you would probably want to wrap the TextBox and Spinner into a custom templated Control or a UserControl to keep in encapsulated.

I guess that might be my problem. I'm trying to wrap it inside a regular class, which then creates the controls (textbox, spinner), but when I register the commands, it seems that only the first set of commands will be working and the rest will just affect the first control. I'm probably doing it wrong though.

>The Spinner's buttons use our "embedded" button style, so you can apply it using something like:

That's exactly what I was looking for - thanks! I do wonder why my buttons are so small unless I define a minimum height though. I add them to a Grid with two row definitions (each with a height of 1*) just like you do, and I give them the same padding as you do (at least that's what Snoop tells me), but while your buttons in the Spinner automatically adjust to fill up the entire height available, mine stays the same (very small) size of around 8 pixels in height. Can you give me a tip on how to make them follow the height? :)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kasper,

That particular style sets HorizontalAlignment and VerticalAlignment both to Center.  You'd probably want to set them to Stretch instead.


Actipro Software Support

Posted 7 years ago by Kasper
Avatar

That was exactly what I was looking for - thank you very much, now it looks really great :)

The latest build of this product (v2018.1 build 0675) was released 15 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.