From the course: Microsoft XAML: 1 Core Concepts

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Event handlers for event attributes

Event handlers for event attributes

From the course: Microsoft XAML: 1 Core Concepts

Start my 1-month free trial

Event handlers for event attributes

- [Instructor] I've added my event attributes to my XAML, and I'm ready to add some code in my C#. Before I do that, I would like to review a couple of items. One, remember that there are two buttons, on line 22 and line 23, that both have the same click handler. They both point to Button_Click. The second thing is remember that every time I added an event attribute, Visual Studios wrote a name for me. It suggested creating a new event handler, and it wrote the name. At the same time, over in the C# code, it created the method. The nice thing that it did is it used the name that it suggested, and it used the correct signature. So the MouseMove event is raising the event, and it's going to pass two arguments over here. Visual Studio created a method with those two arguments. This first item represents the item that raised the event. The second one is event-specific information. In this case, the mouse event is going to hand me a bunch of data bundled inside this MouseEventArgs class…

Contents