我无法弄清楚我缺少哪个资源才能工作,我找不到ei名称空间的消息。
<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 :(得分: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"
答案 1 :(得分:1)