Ordinarily I wouldn't just post an error message on SO, but after a Google search only found one hit, I thought I'd at least open the floor for this error here on SO.
I have a custom control called Sparkline
with a dependency property called Values
of type unit[]
. Here's an example where I use it in a DataTemplate
:
<DataTemplate DataType="{x:Type Activity:ActivityHistory}">
<Controls:Sparkline Grid.Column="1" Values="{Binding Path=Values}" />
</DataTemplate>
This code doesn't compile. I receive the error message:
Tags of type 'PropertyArrayStart' are not supported in template sections.
The line/column numbers indicate the start of the Values
attribute.
This has really thrown me. Searching on Google returned one result where John_C hit exactly the same issue. Unfortunately, his solution involved moving the control to a separate assembly. Well, mine's already in a separate assembly. My guess is that something else is at play.
I've never heard of PropertyArrayStart
. Searching for that only return a few pages related to XAML serialisation. Interesting stuff, but not much help.
Thinking about it, I can't think of any dependency properties in the framework that have array types. Is this allowed?
I also tried using a nested element instead of a markup extension for the Binding
.
<DataTemplate DataType="{x:Type Activity:ActivityHistory}">
<Controls:Sparkline Grid.Column="1">
<Controls:Sparkline.Values>
<Binding Path="Values"/>
</Controls:Sparkline.Values>
</Controls:Sparkline>
</DataTemplate>
...still no luck.
Any ideas welcomed!