WPF ListView项目选择不升级 [英] WPF ListView items selection not escalating

查看:94
本文介绍了WPF ListView项目选择不升级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基本的WPF ListView:

I have a basic WPF ListView as:

<UserControl.Resources>
    <DataTemplate x:Key="batchItem">
        <vw:BatchDetail />
    </DataTemplate>
</UserControl.Resources>
<Grid>
    <Grid.Resources>
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"  Color="LightSteelBlue"/>
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black"/>
    </Grid.Resources>
    <ListView
            HorizontalAlignment="Center"
            BorderThickness="0"
            ItemsSource="{Binding Path=ExistingBatches}"
            ItemTemplate="{DynamicResource batchItem}"
            SelectedItem="{Binding Path=SelectedBatch}">

    </ListView>
</Grid>





在我的开发PC(运行Windows 7)上,单击ItemTemplate中的任意位置即可设置SelectedItem。



在某些生产PC上 - 有些是Windows 7,有些是终端服务器,点击项目模板会设置所选项目。看起来鼠标点击不会升级。



之前有人见过这个,有什么建议可以解决吗?这是.NET Framework的错误吗?!?



On my dev PC (Running Windows 7) clicking anywhere in the ItemTemplate sets the SelectedItem.

On some of the production PC's - some are Windows 7 some are terminal servers, clicking within item template does set the selected item. It looks like the mouse click is not escalated.

Anyone seen this before, got any suggestions to fix it? Is this a bug with the .NET Framework?!?

推荐答案

如果您正在使用relay命令,请将其替换为PRISM的委托命令。 relay命令有一些问题。这是我面对的。一旦将其更改为PRISM的委托命令,问题就会得到解决。
If you are using relay command replace it with PRISM's delegate command . The relay command has some issue. This I have faced it . Once you change it to PRISM's delegate command the issue will be resolved.


这篇关于WPF ListView项目选择不升级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆