Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Usage of DataContext for LegendItem
posted

Hello Everybody,

I have faced with the following situation which I cannot resolve myself,

I need to set an Icon in the legend item, and have created the following LegentItem Style.

<Style x:Key="LegendItemIconStyle" TargetType="ig:LegendItem">

        <Setter Property="IsTabStop" Value="False"/>

        <Setter Property="Template">

            <Setter.Value>

                <ControlTemplate TargetType="ig:LegendItem">

                    <StackPanel Orientation="Horizontal" Margin="0,0,0,0">

                        <Image Width="12" Height="12" Margin="12,2,12,6" 

                                     Source="{Binding Path=BitmapSource, Mode=TwoWay}" />

                        <ig:Title Content="{TemplateBinding Content}" />                        

                    </StackPanel>

                </ControlTemplate>

            </Setter.Value>

        </Setter>

    </Style>

 

But I have no idea how I can get access to the DataContext of the LegendItem. On DateTimeSerie I cannot get access to it. So probably I am doing this wrong and  there is a better way of doing that. So basically the request is to show an icon and to bind it to the Source Property somehow.

 

Any help would be very appreciated,

Reagards,

Kirill

Parents Reply Children