If I understand your question correctly, you can access the Name property by sending a sender to FrameworkElement .
Alternatively, you can simply use the reference object created by the constructor; the instance name matches the name specified in the x:Name attribute.
Both options are shown below.
private void ModelUIElement3D_MouseDown(object sender, MouseButtonEventArgs e) { var element = sender as FrameworkElement; if (element != null) { if (element.Name == "trololo") { } }
Chris taylor
source share