WPF程序中FrameWorkContentElement无法获取相关sender对象内容,求解答,谢谢
窗体中的代码如下
<Button Focusable="False" Height="20" HorizontalAlignment="Center" Margin="4,0" VerticalAlignment="Top" MinWidth="55" Tag="{Binding}" Click="HandleForward">
后端相应绑定方法为
private void HandleForward(object sender, RoutedEventArgs e)
{
//获取当前行的转发对象
FrameworkContentElement
forwardItem = sender as FrameworkContentElement;
//以StatusData实体类装载当前转发行的微博信息
var forwardData = forwardItem.Tag as StatusData;
var postWin = new PosterWindow(viewModel, forwardData, PosterModeEnum.PosterMode.Forward);
postWin.Owner = this;
postWin.ShowDialog();
}
问题为窗体对应的grid可以正常的显示信息,但是按钮事件无法获取到其对应的sender对象
代码的中forwardItem为null,求解如何获取sender对象呢,望各位高手搭救。谢谢了
------解决方案--------------------同样的问题http://bbs.csdn.net/topics/380205411