Fail to use "Apply" in CustomMapping when adapting the Windows 8 default theme in RadTreeMap

3 posts, 0 answers
  1. William
    William avatar
    2 posts
    Member since:
    Apr 2015

    Posted 30 Apr 2015 Link to this post

    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);

    The expected output can been in the first picture (see "expected.png").

     When I add the theme file into my app.xaml:

                    <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"/>

    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.

  2. William
    William avatar
    2 posts
    Member since:
    Apr 2015

    Posted 01 May 2015 in reply to William Link to this post

    <ResourceDictionary Source="TelerikTheme/Telerik.Windows.Controls.DataVisualization.xaml"/>


    The file is from c:\Program Files (x86)\Telerik\UI for WPF Q1 2015\Themes.Implicit\WPF40\Windows8\Themes\Telerik.Windows.Controls.DataVisualization.xaml

  3. Sia
    Sia avatar
    755 posts

    Posted 05 May 2015 Link to this post

    Hello William,

    There should not be such problems when using custom mapping. Since it is difficult to understand what causes your problems, please find attached the source code of our demo. If you manage to modify it in a way that your issue can be observed, it will be easy to find what goes wrong in your case.

    As a small note, you need to change the order of merging the resource dictionaries. Please keep in mind that it should correspond to the dependencies between the telerik binaries as shown in our help.
    Your custom styles should be merged after telerik resources and should be based on telerik styles.


    See What's Next in App Development. Register for TelerikNEXT.

Back to Top