有一个DataTemplate是绑定到一个DataView上的,代码如下:
<DataTemplate x:Key="FriendTemplate">
<Grid >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Label Content="{Binding Path=fusername}" Name="fname" Grid.Row="0"/>
<Label Content="{Binding Path=status}" Name="status" Grid.Row="0" />
</StackPanel>
<Label Content="{Binding Path=re}" Name="re" Grid.Row="1"/>
<Grid.ContextMenu>
<ContextMenu Name="rightMenu" StaysOpen="True">
<MenuItem Header="好友资料" Click="MenuItem_Click_ContactInfo" Name="contactInfo" />
</ContextMenu>
</Grid.ContextMenu>
</Grid>
</DataTemplate>
请问在这个contactInfo点击后如何获取那个label的name属性值?
<DataTemplate x:Key="FriendTemplate">
<Grid >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Label Content="{Binding Path=fusername}" Name="fname" Grid.Row="0"/>
<Label Content="{Binding Path=status}" Name="status" Grid.Row="0" />
</StackPanel>
<Label Content="{Binding Path=re}" Name="re" Grid.Row="1"/>
<Grid.ContextMenu>
<ContextMenu Name="rightMenu" StaysOpen="True">
<MenuItem Header="好友资料" Click="MenuItem_Click_ContactInfo" Name="contactInfo" />
</ContextMenu>
</Grid.ContextMenu>
</Grid>
</DataTemplate>
请问在这个contactInfo点击后如何获取那个label的name属性值?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货