2017-04-07 138 views
0

我想不通哪个资源我缺少这个工作,我得到消息ei命名空间没有找到。isEnabled绑定到其他按钮点击

 <Button 
     Name="btnEnter" 
     Click="btnEnter_Click" 
     Style="{StaticResource SignButtons}" 
     FontFamily="Comic" 
     FontSize="24" 
     FontWeight="DemiBold" 
     Grid.Column="3" 
     Height="51.562" 
     Width="75" 
     Margin="30,23.624,0,0" 
     Grid.Row="3" 
     Template="{DynamicResource EnterButton}"> 
      <i:Interaction.Triggers> 
       <i:EventTrigger EventName="Click"> 
        <ei:ChangePropertyAction 
        TargetObject="{Binding ElementName=btnMultiplication}" 
        PropertyName="IsEnabled" Value="False"/> 
       </i:EventTrigger> 
      </i:Interaction.Triggers> 
     </Button> 

这里是

<Window x:Class="Button_Template.MainWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:local="clr-namespace:Button_Template" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:i="http://schemas.microsoft.com/netfx/2009/xaml/presentation" 

    mc:Ignorable="d" 
+0

向我们展示来自XAML根元素的XML名称空间,应该很容易发现。 –

+0

尝试添加此xmlns'xmlns:ei =“clr-namespace:Microsoft.Expression.Interactivity.Core; assembly = Microsoft.Expression.Interactions”' –

+0

我添加了命名空间,现在错误消息不同 - ChangePropertyAction不存在在“clr-namespace:Microsoft.Expression.Interactivity.C ore; assembly = Microso ft.Expression.Interations” – LetzerWille

回答

1

我建议你遵循这些步骤,当您添加类似ChangePropertyActionCallMethodAction等.. 1.进入混合并打开要插入ChangePropertyAction enter image description here

在添加ChangePropertyAction Blend会全自动添加的xmlns扩展项目,然后选择控制。 enter image description here

因此,您不必手动操作。在将它保存在混合中之后,只需转到VS并实时加载项目并继续。

重要事项交互将被添加到对象和时间线窗口中的选定控件上。

+0

我遵循你的指示,但是当我将ChangePropertyAction拖到Objects和TimeLine中的myButton时,我得到消息:在Button中创建ChangePropertyAction。我点击但没有任何反应。有没有任何按键组合来完成此操作? – LetzerWille

+0

没什么特别的。我只是选择控制,并在行为>> ChangePropertyAction使用doubleClick,它会自动将其添加到按钮。 –

2

ChangePropertyAction类型在Microsoft.Expression.Interactions.dll定义的命名空间。它不是.NET Framework的一部分,但您可以使用NuGet下载此程序集:https://www.nuget.org/packages/MicrosoftExpressionInteractions/

或者您可以从此处下载Blend SDK并添加对其的引用:https://www.microsoft.com/en-us/download/details.aspx?id=10801

的XAML命名空间映射应该然后是:

xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
相关问题