Is it possible to handle an event with a lambda in C++/CX? As an example, what would be the best way to convert this snippet of code from C# into C++/CX?
this.animation.Completed += (s, e) =>
{
animation.Begin();
};
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, that’s the correct syntax. However, we recommend that you use a function handler instead of a lambda because a lambda can introduce a circular references and prevent memory from being freed.
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh755799.aspx