Unplanned
Last Updated: 03 Aug 2023 08:14 by Martin Ivanov
Martin Ivanov
Created on: 03 Aug 2023 08:14
Category: CardView
Type: Feature Request
0
CardView: Add property that sets the header background of the RadCardViewItem

Add property that sets the background of the card's header. Currently to do that you need to edit the ControlTemplate of the RadExpander element in the ControlTemplate of RadCardViewItem. Or use code-behind to find the corresponding Border element and assign its value.

The new property could be set on RadCardView or on the RadCardViewItems.

The following example shows how to set the Background in code:

static MainWindow()
{
	EventManager.RegisterClassHandler(typeof(RadCardViewItem), RadCardViewItem.LoadedEvent, new RoutedEventHandler(OnRadCardViewItemLoaded));
}

private static void OnRadCardViewItemLoaded(object sender, RoutedEventArgs e)
{
	var item = (RadCardViewItem)sender;
	var headerBorder = item.ChildrenOfType<Border>().FirstOrDefault(x => x.Name == "HeaderPanel");
	if (headerBorder != null)                
	{		
		headerBorder.Background = Brushes.Red;
	}
}

0 comments