<DataGridTemplateColumn Header="位置信息" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="查看" Tag="{Binding ElementName=PhoneTextColumn}" x:Name="LocationButton" DataContext="{Binding ElementName=FaUserControl,Path=DataContext}"
Style="{StaticResource NewBtStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<ei:CallMethodAction MethodName="LocationButton_OnClick" TargetObject="{Binding }" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
FaUserControl为整个UserControl
原文地址:https://www.cnblogs.com/Lulus/p/8145739.html
时间: 2024-10-16 08:55:15