Updating custom theme style

I am using a cusomt WPF theme. Is there a way to overwrite a specific property in a named component in a control template. For example I want to change the CornerRadius of the Background (it is a Border) part in the SfAccordionItem template. Is this possible?

Additionally, is there a way to see the template in the custom theme? When I use blend to xtract the template, it seems to provide me with the default rather than the custom theme template.

3 Replies 1 reply marked as answer

VR Vijayalakshmi Roopkumar Syncfusion Team February 5, 2021 11:05 AM UTC

Hi Iliya 
 
Thank you for contacting Syncfusion Support. 
 
Please find the response for the following queries: 
 
S.NO 
Query  
Response 
1 
I am using a cusomt WPF theme. Is there a way to overwrite a specific property in a named component in a control template. For example I want to change the CornerRadius of the Background (it is a Border) part in the SfAccordionItem template. Is this possible? 
We have checked the reported requirement regarding SfAccordion, that you want to override the corner radius of the SfAccordionItem. Yes, it is possible to achieve your requirement and it can be done by overriding the SfAccordionItem template and change the corner radius of the Background maintained as shown in following code. 
 
 
<!--Changing the Corner radius for AccordionItem button--> 
<Border x:Name="background" Background="Transparent" CornerRadius="10"> 
 
 
<Setter.Value> 
<!--Changing the corner radius of SfAccordion Item content--> 
<ControlTemplate TargetType="{x:Type syncfusion:SfAccordionItem}"> 
<Border x:Name="Background" BorderBrush="#FF474747" BorderThickness="{TemplateBinding BorderThickness}" Background="{DynamicResource ContentBackgroundBrush}" CornerRadius="10"> 
 
 
 
 
 
 
 
 
2 
Additionally, is there a way to see the template in the custom theme? When I use blend to xtract the template, it seems to provide me with the default rather than the custom theme template. 
Yes, by editing the template of SfAccordionItem after you customize the theme in SfAccordion, you can able to extract the theme for particular customized theme. For example, we have set the Blend theme for SfAccordion, and we were able to extract the blend template of SfAccordion by editing the template as shown in the following options. The above sample has been prepared using the extracted template with blend theme . 
 
 
 
Please check with the above sample and if you still faces any issue, please send us the video or sample to reproduce this particular issue, it would be helpful for us to proceed on it further. 
 
 
Please let us know if you need any other assistance on this. 
 
Regards, 
Vijayalakshmi VR 


Marked as answer

IL Iliya February 10, 2021 02:36 PM UTC

Can I override the corner radius without overriding the whole template? I would definitely prefer something shorter which only overrides the minimum amount of styling. Also, code-behind is not really a clean solution


VR Vijayalakshmi Roopkumar Syncfusion Team February 11, 2021 01:51 PM UTC

Hi Iliya  
 
Thank you for your update. 
 
In our SfAccordion control, we don't have direct support to change the CornerRadius of the SfAccordionItem. So only we suggest you to override the whole template of SfAccordionItem and SfAccordionButton in which we edited the corner radius of Border maintained in its template . Similarly, you can edit the template of desired theme if you refer the desired Skinmanager theme. For more information refer the following UG link to edit the template of your desired theme.  
 
 
Also we have introduced the new themes such as Material and Office2019 themes. You can export these themes using our ThemeStudio utility in your application for all our Syncfusion controls. For more information, refer the following link: 
 
 
Note: We have provided you the sample in blend theme in our previous update.  If you want to achieve the above requirement in any other desired theme, please let us know the currently using theme . So that we can check and provide you the solution based on it.  
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 
 


Loader.
Up arrow icon