Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute Silverlight 4 Command on Load

How do you implement a Silverlight 4 command to execute when the user control loads instead of being mapped to an explicit button click?

like image 298
Craig Shoemaker Avatar asked Jun 10 '26 02:06

Craig Shoemaker


1 Answers

Or simply add a trigger in xaml for your UserControl:

<i:Interaction.Triggers>
    <i:EventTrigger EventName="Loaded">
        <si:InvokeDataCommand Command="{Binding MyCommand}"/>
    </i:EventTrigger>
</i:Interaction.Triggers>
like image 77
PL. Avatar answered Jun 13 '26 08:06

PL.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!