MVVM에서 여러 개의 버튼을 동적으로 바인딩하고 싶습니다.
1.It ItemControl을 사용하여 동적으로 생성 된 버튼
2. 트리거 이벤트를 호출하지 않았습니다. 도와주세요. 당신이 XAML 어떻게 보일지에MVVM의 ItemsControl에서 EventTrigger가 작동하지 않습니다.
<ItemsControl ItemsSource="{Binding ComponentList,Mode=TwoWay}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Button Tag="{Binding WorkFlowCompId}">
<Button.Content>
<TextBlock Text="{Binding ComponentName,Mode=TwoWay}"/>
</Button.Content>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:InvokeCommandAction Command="{Binding ComponentSelected}"
CommandParameter="{Binding WorkFlowCompId,Mode=TwoWay}" >
</i:InvokeCommandAction>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
이 내가 무엇인가 Interaction.Triggers를 ? –
xmlns : i = "http://schemas.microsoft.com/expression/2010/interactivity"Microsoft.Expression.Interactions for intractions을 사용하고 있습니다. – Ramakrishnan
그러면 질문에 지정할 필요가있을 것입니다. –