Ajouter un trigger à un contrôle en code C# uniquement
Bonjour,
Je souhaite tout simplement transformer le code XAML suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
<Image>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding TickCommands[0][0]}"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseEnter">
<i:InvokeCommandAction Command="{Binding Squares[0][0].MouseEnterCommand}"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeave">
<i:InvokeCommandAction Command="{Binding Squares[0][0].MouseLeaveCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Image> |
En code C#...
Je me perds dans les classes et ne sais pas comment faire.
Merci d'avance pour vos réponses!