Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15.  
  16. namespace KI_Lab07
  17. {
  18. /// <summary>
  19. /// Interaction logic for MainWindow.xaml
  20. /// </summary>
  21. public partial class MainWindow : Window
  22. {
  23. public MainWindow()
  24. {
  25. InitializeComponent();
  26. lstProducts.ItemsSource = DB.GetProducts();
  27. }
  28. private void lstProducts_Do(object sender, MouseButtonEventArgs e)
  29. {
  30. Grid lbi = (Grid)sender;
  31. CheckBox tb = (CheckBox)lbi.FindName("chkKupi");
  32. ListViewItem pr = (ListViewItem)lbi.Parent;
  33. tb.IsChecked = ((bool)tb.IsChecked) ? false : true;
  34. }
  35.  
  36. private void cmdView_SelectionChanged(object sender, SelectionChangedEventArgs e)
  37. {
  38. ComboBoxItem selectedItem = (ComboBoxItem)cmdView.SelectedItem;
  39. lstProducts.SelectedIndex = -1;
  40. if (selectedItem.Tag.Equals("GridView"))
  41. lstProducts.ItemContainerStyle =
  42. (Style)this.FindResource("ListItemBackground");
  43. else
  44. lstProducts.ItemContainerStyle = null;
  45. if (selectedItem.Tag.Equals("ImageDetailView"))
  46. lstProducts.SelectionMode = SelectionMode.Multiple;
  47. else
  48. lstProducts.SelectionMode = SelectionMode.Single;
  49. lstProducts.View = (ViewBase)this.FindResource(selectedItem.Tag);
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement