How to use SeriesItemLabelStyle and HorizontalBarSeriesStyle as a DynamicResource

4 posts, 0 answers
  1. Dhruv
    Dhruv avatar
    15 posts
    Member since:
    Nov 2011

    Posted 15 Feb 2013 Link to this post

    Hi,

    I am using RadChart in my application.I am loading all styles from a resource theme file.
    The problem is that i am unable to use SeriesItemLabelStyle and HorizontalBarSeriesStyle of RadChart as DynamicResource.
    this is a critical issue Since we can have different themes for our application.
     
    Thanks
    Dhruv 
     
  2. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 20 Feb 2013 Link to this post

    Hi Dhruv,

     I tried to reproduce your scenario based on what you said and the Dynamic Resources get applied as expected. Could you please try to modify the attached project so that the issues exhibit there? You may also send us a stripped down runnable version of yours where this reproduces so that we can inspect it locally.

    Regards,
    Evgenia
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Dhruv
    Dhruv avatar
    15 posts
    Member since:
    Nov 2011

    Posted 05 Mar 2013 Link to this post

    Hey Evgenia,

    SeriesItemLabelStyle property worked with dynamic resource but HorizontalBarSeriesStyle is still throwing exception in runtime .
    In your example you used only SeriesItemLabelStyle.

    Thanks,
    Dhruv 

     

     

     

     

  5. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 08 Mar 2013 Link to this post

    Hello Dhruv,

    As my colleague Evgenia said earlier, the sample attached demonstrates the use of a dynamic resources where the behavior you have described is not reproducible. In the attached sample there is style named "MyHorizontalBarStyle" targeting the HorizontalBar.
    <Style x:Key="MyHorizontalBarStyle"
        TargetType="telerik:HorizontalBar">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="telerik:HorizontalBar">
                    <Canvas Opacity="0" x:Name="PART_MainContainer">
                        <Rectangle x:Name="PART_SelectedState"
                                   Height="{TemplateBinding ItemActualHeight}"
                                   Width="{TemplateBinding ItemActualWidth}"
                                   Visibility="{TemplateBinding MaskVisibility}"
                                   Fill="#1FA3EB" />
                        <Canvas.RenderTransform>
                            <ScaleTransform x:Name="PART_AnimationTransform" ScaleX="0"  />
                        </Canvas.RenderTransform>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    and this style is successfully used in the HorizontalBarSeriesDefinition.
    <telerik:HorizontalBarSeriesDefinition ItemStyle="{DynamicResource MyHorizontalBarStyle}"
                                                                   SeriesItemLabelStyle="{DynamicResource MySeriesItemLabelStyle}"
                                                                   ShowItemLabels="True"/>

    Could you please modify the example so the issue is reproducible or elaborate a bit more on the issue.

    Note that as this is a forum thread you either can submit a support ticket where you can attach files, or use a third party web site for uploading and sharing files.

    All the best,
    Peshito
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top