Velo by Wix: Imitating Hover Event on Repeater Container

Motivation

We have a $w.Repeater component with items of users' cards. When we point with the mouse cursor over some item, we want to change the background color of this item to light blue color #CCE4F7, and when the cursor moves off of the item, we want to return the initial white color.

For this, we're going to use two other events that provide repeater API:

Moving Forward With .NET Events, Event-Handlers, and CustomEventArgs

Introduction

In the previous post on Events, we talked about how we are surrounded by events and how useful they can be when writing loosely coupled code. We saw how we can define events, raise, and finally handle events. If you haven’t already, then I will suggest reading that post for the background and then the topics in this post will be easier to follow.

In this post, we will continue our journey and move forward with learning more about Events implementation in .NET. One of the common requirements when raising events is how can we pass data along with event notifications to event-handlers. A very common way to do it using Custom EventArgs.