I have the following Apply method that has been working:
protected override void Apply(Telerik.Windows.Controls.TreeMap.RadTreeMapItem treemapItem, object dataItem)
{
BranchIntegrationDetails details = dataItem as BranchIntegrationDetails;
SolidColorBrush brush = PickBrush(details);
// Apply the color
treemapItem.Background = brush; // Apply additional text
IntegrationStatisticsControl statisticsControl = new IntegrationStatisticsControl()
{
VerticalAlignment = System.Windows.VerticalAlignment.Bottom,
HorizontalAlignment = System.Windows.HorizontalAlignment.Right,
Foreground = ForegroundBrush,
Margin = new System.Windows.Thickness(0,0,10,0)
};
statisticsControl.SetValue(Grid.RowSpanProperty, 2);
Grid grid = treemapItem.ChildrenOfType<Grid>().ElementAt(1);
grid.Children.Add(statisticsControl);
}
The expected output can been in the first picture (see "expected.png").
When I add the theme file into my app.xaml:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="StyleResources.xaml" />
<ResourceDictionary Source="TelerikTheme/Telerik.Windows.Controls.xaml"/>
<ResourceDictionary Source="TelerikTheme/Telerik.Windows.Controls.DataVisualization.xaml"/> <!-- this one is bad -->
<ResourceDictionary Source="TelerikTheme/Telerik.Windows.Controls.Navigation.xaml"/>
</ResourceDictionary.MergedDictionaries>
The control that I want to apply does not anymore (see "unexpected.png"). The same code is still working, I can see my control is added to the Grid, just I could not know why it is not showing.