views:

483

answers:

1

Hi

I'm a designer using Expression blend. Does anyone know how to use the events tab? I'm looking at a column of input fields, such as mouse enter etc. Not sure what to put in these any ideas?

Thanks Judi

+3  A: 

Those input fields correspond to event handlers in code. Try adding a Button to your project, then double click in the input area for the "Click" event. It'll take you directly to the code. Right below the line "// TODO: Add event handler implementation here." add the following:

MessageBox.Show("Hello!");

Now when you click the button you should get a message box. If you take a look for the Xaml of your button you should see that the Click attribute is assigned a value that matches the function name from the code file (i.e. private void Button_Click(object sender, EventArgs ea) should correspond to the Xaml <Button Click="Button_Click"/>). The part that is present in code (the function) is usually referred to as an "event handler" and this is the value you see in the input area next to the events in Blend.

The best practices for working with events are generally say for you (the designer) to primarily use events as triggers for storyboards and to not assign event handlers in Blend. A developer can wire up the events they require in code; hopefully you don't need to use events other than to trigger animations or VisualStateManager changes.

James Cadd