You can take advantage of the fact that these are Routed Events, and set a single handler on a parent element.
This allows a single event handler to handle all events of the child controls. The OriginalSource
property of the event args will provide the UIElement that was clicked, if, for example, you subscribed to UIElement.MouseLeftButtonDown
or a similar "shared" event.
You would do this by adding, in your XAML, to your container:
<Grid UIElement.MouseLeftButtonDown="CommonClickHandler">
<!-- Your elements here -->
Then, in your code behind:
private void CommonClickHandler(object sender, MouseButtonEventArgs e)
{
Image picture = e.OriginalSource as Image; //OriginalSource is the original element
if (picture != null)
picture.Visibility = Visibility.Collapsed;
}