hell_o__world 2016-12-10 08:04 采纳率: 0%
浏览 849

新人WPF问题求助,万分感谢!

我的窗体布局是这样的: 最外层是一个Canvas,第二层也是一个Canvas,第三层是一个DataGrid,
DataGrid数据绑定上了,Command也绑定了,但是事件响应不了,后面测试发现整个DataGrid
所有事件都没有响应

  • 写回答

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>
    
    评论

报告相同问题?