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

MonthViewSettings properties cannot be set using DynamicResource

Thread ID:

Created:

Updated:

Platform:

Replies:

128848 Feb 13,2017 12:52 AM UTC Feb 14,2017 12:49 PM UTC Xamarin.Forms 2
loading
Tags: SfCalendar
Tomas Szabo
Asked On February 13, 2017 12:52 AM UTC

I'm using 

calendar.MonthViewSettings.SetDynamicResource (VisualElement.StyleProperty, "some.resource") 

to set dynamic styles on SfCalendar.MonthViewSettings. However it seems following properties cannot be set using DynamicResource and they have their default (built-in) values:

MonthViewSettings.TodayTextColorProperty
MonthViewSettings.SelectedDayTextColorProperty
MonthViewSettings.DateSelectionColorProperty

When setting these properties directly (i.e. not using Xamarin Forms styles but directly on SfCalendar instance) they are working as expected.

Rathana Kumar Sekar [Syncfusion]
Replied On February 13, 2017 11:43 AM UTC

Hi Tomas,

Thanks for contacting Syncfusion Support.

Currently, we are analyzing the reported issue, "MonthViewSettings properties cannot be set using DynamicResource." We will provide further update on February 14, 2017.

Regards,
Rathanakumar S.

Rathana Kumar Sekar [Syncfusion]
Replied On February 14, 2017 12:49 PM UTC

Hi Tomas,

We have checked the reported issue based on the provided details.On analyzing further, we found that applying Application Resource as Dynamic Resource has some limitation in Xamarin.Forms. Please find the Xamarin.Forms forum link which is related to the reported issue in below

Link: https://forums.xamarin.com/discussion/65252/dynamicresource-limitation-for-onplatform-in-xaml-xamarin-forms

We have prepared sample to show demo on "How to use StaticResource for MonthViewSettings API's."Please find the sample from below link.

Sample: http://www.syncfusion.com/downloads/support/forum/128848/ze/calendartestsample-242837818 

So we suggest you to use the following ways to apply Application Resource to customize the MonthViewSettings API's.

Solution 1: Use Application Resource as Static Resource

<MonthViewSettings TodayTextColor="{StaticResource todaytextcolor} " />


Solution 2: Access the application Resource from code behind

calendar.MonthViewSettings.TodayTextColor =(Color) Application.Current.Resources["todaytextcolor"];


Regards,
Rathanakumar 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.

Please sign in to access our forum

or the page will be automatically redirected to 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

;