private void OnDeleteMachineFunction(object sender, RoutedEventArgs e) { MachineFunctions.Remove((sender as FrameworkElement).DataContext as MachineFunction); }