Handle a Button Click with Shared button click handler
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="WPF" Height="200" Width="200"> Name="button1" Width="75">Button One Name="button2" Width="75">Button Two Name="button3" Width="75">Button Three
//File:Window.xaml.vb Imports System.Windows Imports System.Windows.Controls Namespace WpfApplication1 Public Partial Class Window1 Inherits Window Public Sub New() InitializeComponent() End Sub Private Sub SharedButtonClickHandler(sender As Object, e As RoutedEventArgs) Dim source As Button = TryCast(e.OriginalSource, Button) If source IsNot Nothing Then MessageBox.Show("You pressed " & source.Name, Title) End If End Sub End Class End Namespace