I have authored some custom classes that I would like to create using XAML:
<Grid Width="300" Height="300">
<l:DashboardTable>
<l:DashboardTable.DashboardTableQuery>
<dq:DashboardTableQuery
ConnectionString="Data Source=bunkerhill;Initial Catalog=emgov_data;User Id=emgovadmin;Password=p@$$word;"
Query="select datename(month, cr_tb_DateDue) AS Month, sum(cr_tb_AmountTransaction) AS Total from cr_tb_transactionbill where Year(cr_tb_DateDue) = 2005 and Month(cr_tb_DateDue) IN (1,2,3,4) group by datename(month, cr_tb_DateDue)"
>
<dq:DashboardTableQuery.DataColumns>
<dq:DataColumn ColumnN开发者_如何学运维ame="Month" ColumnOrder="0" Label="Month" />
<dq:DataColumn ColumnName="Total" ColumnOrder="1" Label="Total" />
</dq:DashboardTableQuery.DataColumns>
</dq:DashboardTableQuery>
</l:DashboardTable.DashboardTableQuery>
</l:DashboardTable>
</Grid>
The problem is that I get a XamlParseException when I try to run this XAML. I have determined it is when it gets to the dq:DataColumn element. It seems like this is only happening when I have a property that then has a collection and then several items in the collection that I am getting this issue.
Has any encountered anything similar? I am try to achieve this all in XAML declaratively.
There are a couple of things I can think of for the post Xaml to work.
- The
DashboardTableQuery
must create an instance of the collection that is then exposed as theDataColumns
property. - The collection type exposed by
DataColumns
must implementIList
.
精彩评论