Button style like the Property Grid Toggle Buttons

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 2 years ago by Eric P
Version: 16.1.0634
Avatar

This should be a simple question. I would like to style two buttons (or maybe toggle buttons) to look like the toggle buttons on the PropertyGrid. These toggle buttons have a blue outline and a light blue background.

http://www.actiprosoftware.com/content/images/products/controls-wpf-propertygrid/Filtering.png

The button I am talking about is shown in this image in the upper left corner of the property grid. I was searching through the Actipro Styles thinking I could find the XAML but no luck so far. Any suggestions would be appreciated.


Thanks,
-eric

Comments (7)

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

Hi Eric,

I believe those use this Style:

{x:Static themes:SharedResourceKeys.ToolBarEmbeddedButtonBaseStyleKey}


Actipro Software Support

Posted 2 years ago by Eric P
Avatar

So I was using the EmbeddedButtonBaseStyleKey but I changed it to ToolBarEmbeddedButtonBaseStyleKey and I do not see any visual difference. I get a light blue background when I mouse over the button or when its "on" (IsChecked = true). I tried using a ToggleButton and a RadioButton.

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

Hi Eric,

ToolBarEmbeddedButtonBaseStyleKey is based on EmbeddedButtonBaseStyleKey but adds themed Background, BorderBrush, Foreground, CornerRadius, Padding settings and sets it as a tab stop too.


Actipro Software Support

Posted 2 years ago by Eric P
Avatar

Should I expect to see a darking blue border around the button when IsChecked = true when using ToolBarEmbeddedButtonBaseStyleKey (like the picture posted)?

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

Yes, I believe it will show a blue border when checked.


Actipro Software Support

Posted 2 years ago by Eric P
Avatar

I have used both ToolBarEmbeddedButtonBaseStyleKey and EmbeddedButtonBaseStyleKey but I do not see the blue border. I do see a light blue background with no boarder. I asusme this is also tied to which theme is loaded? I am uisng both the Metro Light and Dark theme. Maybe the blue boarder is for another theme. I will poke around.

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

Hi Eric,

Correct, the Metro themes define a border color that is the same as the background color so it doesn't appear different in that theme.  If you use a theme like Aero you can see a different border color.  The border color is defined by this asset resource: AssetResourceKeys.ToolBarButtonBorderCheckedNormalBrushKey.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.