views:

57

answers:

0

Hello,

I made some changes with chart (WPF toolkit) component at the MS Blend 3. A lot of stuff like this:

<Style x:Key="BoardsLineDataPointStyle" TargetType="{x:Type chartingToolkit:LineDataPoint}">
<Setter Property="Background" Value="Orange"/>
<Setter Property="Width" Value="{Binding Mode=OneWay, Path=Value}"/>
<Setter Property="Template" Value="{DynamicResource BoardsLineDataPointControlTemplate}"/>
</Style>
 </UserControl.Resources>
 <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource EquipmentMapDataSource}}">
  <chartingToolkit:Chart Title="" Style="{DynamicResource ChartStyle}" ChartAreaStyle="{DynamicResource EdgePanelStyle}">
   <chartingToolkit:LineSeries Title="Boards" ItemsSource="{Binding Mode=OneWay, Path=Boards}"
  DependentValuePath="y" 
           IndependentValuePath="x" DataPointStyle="{DynamicResource BoardsLineDataPointStyle}"/>

And I can see the result at design mode window but runtime result is without any styles at all. I belive i did something wrong and styles can't be resolved.

I have tried different ways (including ResourceDictionaries) but lets say the current code has:

  • declaration of xml data source at the Resources section of App.xaml and it binds to the target control briliantly even at runtime mode
  • no any declarations at Resources of main window
  • all styles in UserControl.Resources section of the control which we are speaking about
  • {DynamicResource style} bindings at the control

And just in case will say again: design mode of the Blend resolves styles without any problems.

Thank you