private void ListBox_Comment_RightTapped(object sender, RightTappedRoutedEventArgs e) { if (e.OriginalSource.GetType() == typeof(TextBlock)) { OtherHelper.CopyTextToClipboard((e.OriginalSource as TextBlock).Text); } else if (e.OriginalSource.GetType() == typeof(Windows.UI.Xaml.Shapes.Rectangle)) { OtherHelper.CopyTextToClipboard(((e.OriginalSource as Windows.UI.Xaml.Shapes.Rectangle).DataContext as CommentsItem).content); } }