How to use Lambda in this case?

Jul 22 2014 5:09 AM
Hi,

I have just simply case, in XAML code I have some storyboard

<storyboard>
.....
</storyboard>


I want to change property of one of my control after the storyboard will end, so I want to use completed event of storyboard:


<storyboard completed = "My Method">
....
</storyboard>

 private void My Method(object sender, EventArgs e)
        {
MyControl.IsOpen = false;
        }


It's simply, but I wondering why I need to create some delegate and handling it by My Method just for change property.

If it's possible to do something like this (i don't know how exactly;)):

<storyboard completed = " (() => {MyControl.IsOpen = false}) "
.....
</storyboard>



Answers (2)