首页 新闻 会员 周边

caliburn.micro的action

0
悬赏园豆:10 [待解决问题]

<UserControl x:Class="SteelIntegrationPlatform.Views.ShapeStencilsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:cal="http://www.caliburnproject.org"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:tool="clr-namespace:SteelIntegrationPlatform.Tools"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">

 

    <Grid>
        <ItemsControl >
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Name="wp"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
                <ItemsControl.Items >
                <ContentControl  IsHitTestVisible="True" Name="button" >
                    <ContentControl.Content>
                        <Path Stroke="Black" StrokeThickness="1" Data="M 0,20 L 30 0 L 60,20 L 30,40 Z"/>
                    </ContentControl.Content>
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="MouseLeftButtonDown">
                            <cal:ActionMessage MethodName="nishishui"/>
                        </i:EventTrigger> 
                    </i:Interaction.Triggers>
                </ContentControl>
              
            </ItemsControl.Items>
        </ItemsControl>
    </Grid>
</UserControl>

当按下鼠标左键时,事件nishishui不触发?这是为什么?

EventName="MouseMove"时事件能够触发

lfz-woniu的主页 lfz-woniu | 初学一级 | 园豆:194
提问于:2012-06-13 16:20
< >
分享
所有回答(1)
0

是否不支持MouseLeftButtonDown事件?查看下文档。

无之无 | 园豆:5095 (大侠五级) | 2012-06-13 16:29

是不支持,请问查看哪个文档?msdn上contentcontrol是支持MouseLeftButtonDown时间的

支持(0) 反对(0) lfz-woniu | 园豆:194 (初学一级) | 2012-06-14 14:49

@lfz-woniu: 你用的 不是ContentControl而是一个i:Interaction,你把这个修正下,使用ContentControl 的事件看。

支持(0) 反对(0) 无之无 | 园豆:5095 (大侠五级) | 2012-06-14 14:54
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册