Advertisement
Guest User

Untitled

a guest
Jun 21st, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16.  
  17. namespace WpfApplication1
  18. {
  19. /// <summary>
  20. /// Interaction logic for MainWindow.xaml
  21. /// </summary>
  22. public partial class MainWindow : Window
  23. {
  24. public MainWindow()
  25. {
  26. InitializeComponent();
  27.  
  28. var grid = new Grid();
  29.  
  30. grid.Children.Add(new Button { Content = "Anal" });
  31. grid.Children.Add(new Button { Content = "Anal" });
  32. grid.Children.Add(new Button { Content = "Oral" });
  33. grid.Children.Add(new TextBox { Text = "Oral" });
  34.  
  35. var controls = grid.Children.OfType<UIElement>();
  36.  
  37. var excluded = controls.Where(control => (control is Button) && (control as Button).Content == "Anal");
  38.  
  39. var result = controls.Except(excluded);
  40.  
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement