Hi,
You can do that by using a custom RowHeaderTemplate. First, you can associate a brush with each resource through its Tag property. Alternatively you can define a custom resource class, which exposes a new property for the background brush.
calendar.ItemResources.Add(new Resource() { Name = "resource 1", Tag = Brushes.Red });
calendar.ItemResources.Add(new Resource() { Name = "resource 2", Tag = Brushes.Green });
calendar.ItemResources.Add(new Resource() { Name = "resource 3", Tag = Brushes.Orange });
calendar.ItemResources.Add(new Resource() { Name = "resource 4", Tag = Brushes.Purple });
Then you can specify a custom RowHeaderTemplate, which binds to the background property:
<p:Calendar x:Name="calendar" CurrentView="ResourceView">
<p:Calendar.ResourceViewSettings>
<p:ResourceViewSettings>
<p:ResourceViewSettings.RowHeaderTemplate>
<DataTemplate>
<Border Background="{Binding Resource.Tag}">
<TextBlock Text="{Binding HeaderText}" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</DataTemplate>
</p:ResourceViewSettings.RowHeaderTemplate>
</p:ResourceViewSettings>
</p:Calendar.ResourceViewSettings>
</p:Calendar>
Finally, you need to set the appropriate alignment for the header content (by default it appears centered inside the header):
calendar.ResourceViewSettings.HeaderStyle.HorizontalAlignment = HorizontalAlignment.Stretch;
calendar.ResourceViewSettings.HeaderStyle.VerticalAlignment = VerticalAlignment.Stretch;
I hope this helps.
Regards,
Meppy