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

"Working" - Animation in ToggleButtons in ToolBar

1 Answer 97 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 09 Jul 2018, 05:53 AM

Hi Guys,

 

is it somehow possible to override the "IsChecked" style of a RadToggleButton within the RadToolBar?
I would like to have a "working"-spinner animation when a button is pressed.

 

Thank you very much.

1 Answer, 1 is accepted

Sort by
0
Vicky
Telerik team
answered on 12 Jul 2018, 05:35 AM
Hello Markus,

It is possible to achieve the desired by you appearance, using ToolBarContainerStyleSelector.

Most important thing for your case is that the toolbar has predefined styles for RadToggleButton. In order to customize the styles for any of the elements in the toolbar you need to override the ToolBarContainerStyleSelector of the corresponding one - in your case RadToolBar.

You need to add a ContainerStyle targeting the specific control (RadToggleButton in your case as a TargetName property), add its predefined style and add/edit/override the properties you need. In your case, that would be the ControlTemplate's VisualStateManager groups, referring checked states.

Please note that setting a style directly on an element in the toolbar is won't work because the selector will override it.

Attached you can find a sample project I created for you, demonstrating how to style the RadToggleButton inside RadToolbar, using the above mentioned ToolBarContainerStyleSelector, as well as Implicit Styles.

Please check it and let me know if it helps.

Regards,
Vicky
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ToolBar
Asked by
Markus
Top achievements
Rank 1
Answers by
Vicky
Telerik team
Share this question
or