wpf - 绑定到另一个控件行为
问题描述
我创建了一个混合行为来设置数据网格的列。
<DataGrid ItemsSource="{Binding Source}">
<i:Interaction.Behaviors>
<behaviors:DataGridBehavior ColumnsSource="{Binding SourceHeaders}"/>
</i:Interaction.Behaviors>
</DataGrid>
我现在想要做的是在另一个控件中使用 ColumnsSource (目前正在样式的 Template 属性中捕获)。像这样的东西:
<ItemsControl ItemsSource={{Binding ???, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}} />
由于缺乏搜索结果,我不确定这是否可能。我正在开始研究附加属性,但我想做的可能吗?
解决方案
推荐阅读
- c# - IJobDetail 作业 = JobBuilder.Create 在同一实例中。石英网
- java - 在 aspose word 中使用 FieldMergingCallback 时 MS Word 邮件合并字段格式丢失
- python - 根据HSV图像的Value通道为图像创建条件掩码
- tensorflow - Tensorflow 与 import_graph_def 和 ExponentialMovingAverage 共置问题
- java - 我们可以将作为 jenkins 管道的一部分创建的 aritfacts (.jar/.zip) 上传到 Azure Devops 吗?
- sql - 如何在 MS SQL Server 表上进行选择以在一行中显示其某些列数据并使用 sum 函数
- datetime - 如何在颤动中禁用日历中的前几天?
- python - TypeError:需要一个类似字节的对象,而不是 Python3.6.8 中的“str”
- java - Is there a way to save multiple config files in a sub-folder of the plugin-folder (Spigot & Maven)
- javascript - 处理来自 API cat-facts 的 ReadableStream 响应