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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Theme Documentation

Thread ID:

Created:

Updated:

Platform:

Replies:

141776 Jan 3,2019 06:29 PM UTC Jan 11,2019 11:56 AM UTC Xamarin.Forms 3
loading
Tags: General
Dean Martin
Asked On January 3, 2019 06:29 PM UTC

Hi,

In the announcement for Essential Studio 2018 Volume 4 you mentioned theme support:


....any idea where I can find documentation on implementing this?

Thanks,
Dean



Divya Venkatesan [Syncfusion]
Replied On January 4, 2019 12:50 PM UTC

Hi Dean, 
  
We are in progress of updating the documentation for theming support and it will be updated online before the end of January 2019. However, you can follow the below steps to apply theme for the Syncfusion controls. 
  
You can apply the predefined common theme for all the Syncfusion controls using SyncfusionThemeDictionary by creating the instance for SyncfusionThemeDictionary and merge the common theme resources as in the following code snippet. 
  
Code snippet for common theme: 
  
<Application.Resources> 
    <syncTheme:SyncfusionThemeDictionary> 
        <syncTheme:SyncfusionThemeDictionary.MergedDictionaries> 
            <syncTheme:LightTheme /> 
        </syncTheme:SyncfusionThemeDictionary.MergedDictionaries> 
    </syncTheme:SyncfusionThemeDictionary> 
</Application.Resources> 
  
You can also override the values for the predefined keys as needed after merging the common theme resources as shown below. 
  
<Application.Resources> 
    <syncTheme:SyncfusionThemeDictionary> 
        <syncTheme:SyncfusionThemeDictionary.MergedDictionaries> 
            <syncTheme:LightTheme /> 
                <ResourceDictionary> 
                    <Color x:Key="SyncPrimaryColor">Green</Color> 
                    <Color x:Key="SyncErrorColor">#FF9000</Color> 
                    <Color x:Key="SfTextInputLayoutHintColor">Maroon</Color> 
                </ResourceDictionary> 
            </syncTheme:SyncfusionThemeDictionary.MergedDictionaries> 
    </syncTheme:SyncfusionThemeDictionary> 
</Application.Resources> 
  
Please find the list of available keys in the attached file which can be used to override the default values. 
  
  
It contains common keys such as SyncPrimaryColor, SyncPrimaryLightColor, SyncPrimaryDarkColor, SyncPrimaryForegroundColor, SyncPrimaryLightForegroundColor, SyncPrimaryDarkForegroundColor, SyncSuccessColor, SyncErrorColor, SyncWarningColor and SyncInfoColor for all Syncfusion UI controls which are mapped to specific UI element of the controls. Other than these items, there are other keys specific to every control like SfTextInputLayoutHintColor for SfTextInputLayout. You can use these keys to override the default values. 
  
We have prepared a sample with SfTextInputLayout by overriding primary color and error color and hint color of SfTextInputLayout. Please download the sample from the following link. 
  
  
Screenshot: 
  
Regards, 
Divya Venkatesan 
 


Michael Prabhu M [Syncfusion]
Replied On January 11, 2019 09:56 AM UTC

Hi Urs Geser,

It was a known Xamarin.Forms framework issue in v2.4.0. To know more about it refer the below link,
 

Bugzilla link: https://bugzilla.xamarin.com/show_bug.cgi?id=60788

It can be resolved by upgrading the Xamarin.Forms package to v3.1 or latest.

Please get back to us if you need any other assistance from us. 

Regards, 
Michael

 


Urs Geser
Replied On January 11, 2019 11:56 AM UTC

Hi, 

This doesn't work with Xamarin Forms V2.5.1.527436.
An exception occurred: 

System.ArgumentException: 'A resource with the key 'SyncPrimaryColor' is already present in the ResourceDictionary.'

Thanks
Urs



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

;