我的窗体布局是这样的: 最外层是一个Canvas,第二层也是一个Canvas,第三层是一个DataGrid,
DataGrid数据绑定上了,Command也绑定了,但是事件响应不了,后面测试发现整个DataGrid
所有事件都没有响应
新人WPF问题求助,万分感谢!
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
5条回答 默认 最新
hell_o__world 2016-12-10 08:02关注DataGrid是这样的,
Cursor="Hand" d:IsLocked="False" CanUserAddRows="False" CanUserDeleteRows="False" GridLinesVisibility="None" FontSize="13"
IsHitTestVisible="True" MouseLeftButtonDown="DataGrid_MouseLeftButtonDown" Background="Blue" VerticalScrollBarVisibility="Auto">
<br> <Style.Triggers><br> <Trigger Property="IsMouseOver" Value="true"><br> <Setter Property="Background" Value="#FFF1FAFF"/><br> <Setter Property="FontSize" Value=" 20"/><br> <Setter Property="Height" Value="30"/><br> <Setter Property="Foreground" Value="Blue"/><br> </Trigger><br> <br>
VerticalAlignment="Center" HorizontalAlignment="Center"
Command="{Binding Path=DataContext.SearchSongSelectedCommand, RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type DataGrid}}}"/></DataGrid>解决 无用评论 打赏 举报