All day settings don't work when labelIndicator is used

In the sample code provided for the Schedule control (https://github.com/syncfusion/xamarin-demos), the all day settings (eg, AllDayAppointmentColor) do not work when the labelIndicator is present.

Example settings:
<schedule:SfSchedule.WeekViewSettings>
     <schedule:WeekViewSettings AllDayAppointmentLayoutColor="Red" ShowAllDay="True"/>
</schedule:SfSchedule.WeekViewSettings>

With the above setttings, the all day appointments should have a red background:


However, once you add the label indicator, which is used on the Drag and Drop sample to show when an appointment is dropped, the red bar doesn't show.

Label indicator:
<Label x:Name="labelIndicator" Text="Label" TextColor="White"  
     VerticalTextAlignment="Center" HorizontalTextAlignment="
     HeightRequest="0" Opacity="0"
     VerticalOptions="End" HorizontalOptions="FillAndExpand">
</Label>



This looks like a bug, but I'm wondering if there are workarounds to get it working?

Thanks

3 Replies 1 reply marked as answer

MS Muniappan Subramanian Syncfusion Team July 29, 2020 12:07 PM UTC

Hi Michael, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your query “All day settings don't work when label Indicator is used in SB”. The DayViewSettings, WeekViewSettings, and WorkWeekViewSettings have been initialized in the SetNonAccessibleBlock () method from the Behavior class. In this method you should set the AllDayAppointmentLayoutColor. We have modified the sample for the same, please find the sample from the below link, 
 
Please refer the below code snippet to set AllDayAppointmentLayoutColor in schedule. 
Code Snippet 
private void SetNonAccessibleBlocks() 
        { 
            if (Device.RuntimePlatform == "Android" || Device.RuntimePlatform == "iOS") 
            { 
                NonAccessibleBlocksCollection nonAccessibleBlocks = new NonAccessibleBlocksCollection(); 
                var nonAccessibleBlock = new NonAccessibleBlock(); 
                nonAccessibleBlock.StartTime = 13; 
                nonAccessibleBlock.EndTime = 14; 
                nonAccessibleBlock.Text = "Lunch time"; 
                nonAccessibleBlocks.Add(nonAccessibleBlock); 
 
                var dayViewSettings = new DayViewSettings(); 
                dayViewSettings.NonAccessibleBlocks = nonAccessibleBlocks; 
                dayViewSettings.AllDayAppointmentLayoutColor = Color.Red; 
                this.schedule.DayViewSettings = dayViewSettings; 
 
                var weekViewSettings = new WeekViewSettings(); 
                weekViewSettings.NonAccessibleBlocks = nonAccessibleBlocks; 
                weekViewSettings.AllDayAppointmentLayoutColor = Color.Red; 
                this.schedule.WeekViewSettings = weekViewSettings; 
 
                var workWeekViewSettings = new WorkWeekViewSettings(); 
                workWeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocks; 
                workWeekViewSettings.AllDayAppointmentLayoutColor = Color.Red; 
                this.schedule.WorkWeekViewSettings = workWeekViewSettings; 
            } 
        } 
 
 
We hope that this helps you, kindly revert us if you have any concern.  
 
Regards,   
Muniappan S. 


Marked as answer

MI Michael July 29, 2020 09:31 PM UTC

Thank you, Muniappan, that works. 

I missed that the behaviour class was instantiating the settings, overriding what was specified in the XAML. 
Thanks for your clarification and sample code.


MS Muniappan Subramanian Syncfusion Team July 30, 2020 09:02 AM UTC

Hi Michael, 
 
Thank you for the update. 
 
We are glad that our solution meets your requirement. Please let us know if you need any further update. As always, we are happy to help you out. 
 
Regards, 
Muniappan S.

Loader.
Up arrow icon