2017-04-07 14 views
0

これが機能するためにどのリソースが不足しているのか分かりません。ここ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:ei = "clr-namespace:Microsoft.Expression.Interactivity.Core; assembly = Microsoft.Expression.Interactions" –

+0

名前空間を追加しましたが、エラーメッセージが違う - ChangePropertyActionが存在しない"Clr-namespace:Microsoft.Expression.Interactivity.C ore; assembly = Microso ft.Expression.Intera ctions" – LetzerWille

答えて

1

私はあなたがChangePropertyActionCallMethodAction、などのようなものを追加しているときに、これらの手順に従うようにあなたを示唆している... 1.:

XAML名前空間のマッピングは、その後でなければなりませんあなたはChangePropertyActionブレンドを追加ChangePropertyAction enter image description here

後に自動にの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。ブレンドして、開くために

xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
関連する問題