I have a template for items control shown below. I need separate instances of colorProvider for each item in the template. Each item in the items control requires a seperate instance of the Color Provider depending on the item it is bound to. How do i create multiple copies of staticresource so that the staticresource is only available for that item.
<ItemsControl x:Name="itemsControl" ItemsSource="{Binding DataList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid MinHeight="250">
<ContentPresenter Content="{Binding }" ContentTemplateSelector="{StaticResource chartSelector}">
<ContentPresenter.Resources>
<v:ColorProvider x:Key="colorProvider"/>
</ContentPresenter.Resources>
</ContentPresenter>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>