locked
Implicit Styles Charts, ColumnDataPoint RRS feed

  • Question

  • I don't grok how Implicit Styles are implemented in Silverlight 4. As I understand, ResourceDictionaries are keyed by strings, but what happens when implicit styles are involved, are they keyed by type? 

    Secondly, why is it that I can set a chart style implicitly, but I can't do the same for a ColumnDataPoint ? Can someone point to me the mechanics of how this operates?

    Friday, August 27, 2010 8:15 AM

Answers

  • Hi,

    Maybe you're right that they are keyed by type, as described in this article:

    http://www.silverlightshow.net/items/Implicit-Styles-in-Silverlight-4.aspx

    About the columndatapoint, I'm not sure the reason, but we may have a not very good workaround, which is that we can set the DataPointStyle in a ColumnSeries implicit Style:

    <Style TargetType="toolkit:ColumnSeries">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:ColumnSeries">
                    <Canvas x:Name="PlotArea"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="DataPointStyle" Value="{StaticResource ColumnDataPointStyle1}"/>
    </Style>


     

    Monday, August 30, 2010 12:40 AM

All replies

  • Hi,

    Maybe you're right that they are keyed by type, as described in this article:

    http://www.silverlightshow.net/items/Implicit-Styles-in-Silverlight-4.aspx

    About the columndatapoint, I'm not sure the reason, but we may have a not very good workaround, which is that we can set the DataPointStyle in a ColumnSeries implicit Style:

    <Style TargetType="toolkit:ColumnSeries">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:ColumnSeries">
                    <Canvas x:Name="PlotArea"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="DataPointStyle" Value="{StaticResource ColumnDataPointStyle1}"/>
    </Style>


     

    Monday, August 30, 2010 12:40 AM
  • Thank you. The more I read about namescopes the more confused I get.

    As I understand it, at the simplest level, looking up a resource starts from the element, working up to the parent.

    However, it gets confusing when a control from another assembly start loading resources. If I define an implicit style in my app, how does the control know to use the new implicit style, and ignore the one originally defined? Furthermore, how does the original styles in the assembly get loaded into resources? Does it get loaded into App.Resources or else where?

    Monday, August 30, 2010 2:13 AM