可以说我得到了以下用户控制:
<UserControl x:Class="MyUserControl">
    <tk:DataGrid>
        <tk:DataGrid.Columns>
            <!-- some columns -->
        </tk:DataGrid.Columns>
    </tk:DataGrid>
</UserControl>
实际上,我无法定义数据网格应该有哪些列,因为我需要在很多地方使用这个控件,使用不同的列。这是我想做的事情:
<UserControl x:Class="MyPanel">
    <ui:MyUserControl>
        <Columns>
            <!-- columns that will go into the data grid -->
        </Columns>
    </ui:MyUserControl>
</UserControl>
有可能实现这一目标吗?
PS:DataGrid.Columns 是只读的,无法将其绑定到其他东西。