We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Style basedon not working?

Thread ID:

Created:

Updated:

Platform:

Replies:

127499 Nov 19,2016 09:50 AM UTC Nov 21,2016 09:46 AM UTC WPF 1
loading
Tags: ButtonAdv
Marcus Scholle
Asked On November 19, 2016 09:50 AM UTC

Hey together,

so I'm trying to build an application where I'm using some of the ButtonAdv-controls.
As I'm also coding some triggers connected to it, I've to access the style.
However, I can't get the basedon attribute working on this one.

<Style x:Key="SyncButtonAdvMainPage" TargetType="{x:Type syncfusion:ButtonAdv}" BasedOn="{StaticResource MetroButtonAdvStyle}">
     <Setter Property="Margin" Value="2"/>
     <Setter Property="HorizontalContentAlignment" Value="Left"/>
     <Setter Property="BorderThickness" Value="0"/>
     <Setter Property="SizeMode" Value="Normal"/>
     <Setter Property="IconHeight" Value="30"/>
</Style>
Gives me an error when using it for a control that the ressource couldn't be resolved.
It works for regular (not Syncfusion) buttons tough as I'm referencing the style and the theme in App.xaml.

<ResourceDictionary>
       <ResourceDictionary.MergedDictionaries>
          <ResourceDictionary Source="/Syncfusion.Shared.WPF;component/SkinManager/MetroStyle.xaml"/>
       </ResourceDictionary.MergedDictionaries>
       <Style x:Key="MetroButtonBase" TargetType="{x:Type Button}" BasedOn="{StaticResource MetroButtonStyle}">
          <Setter Property="Margin" Value="5" />
       </Style>
</ResourceDictionary>
Some ideas on this?
Thanks and greetings.

Mariappan S [Syncfusion]
Replied On November 21, 2016 09:46 AM UTC

Hi Marcus 
 
Thank you for contacting Syncfusion support 
 
We have checked your updated code. In this you have merged MS control theme resource to our ButtonAdv control. So it doesn’t work for our control. To override ButtonAdv control, the path need to use is 
 
 “<ResourceDictionary Source="/Syncfusion.Shared.WPF;component/Controls/ButtonControls/Button/Themes/MetroStyle.xaml" />”.  
 
Please refer below link to get our control resource path. 
 
 
We have prepared a sample with ButtonAdv. In this sample, we have override ButtonAdv control style with BasedOn property to use Metro ButtonAdv Style. Please download the sample from the below link. 
 
Sample link: ButtonAdvSample
 
 
Regards, 
Mariappan S.  




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;