private void ButUnpair_Click(object sender, RoutedEventArgs e) { Peripheral p = (Peripheral)((FrameworkElement)sender).DataContext; _viewModel.Unpair(p); }