Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace KI_Lab07
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- lstProducts.ItemsSource = DB.GetProducts();
- }
- private void lstProducts_Do(object sender, MouseButtonEventArgs e)
- {
- Grid lbi = (Grid)sender;
- CheckBox tb = (CheckBox)lbi.FindName("chkKupi");
- ListViewItem pr = (ListViewItem)lbi.Parent;
- tb.IsChecked = ((bool)tb.IsChecked) ? false : true;
- }
- private void cmdView_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- ComboBoxItem selectedItem = (ComboBoxItem)cmdView.SelectedItem;
- lstProducts.SelectedIndex = -1;
- if (selectedItem.Tag.Equals("GridView"))
- lstProducts.ItemContainerStyle =
- (Style)this.FindResource("ListItemBackground");
- else
- lstProducts.ItemContainerStyle = null;
- if (selectedItem.Tag.Equals("ImageDetailView"))
- lstProducts.SelectionMode = SelectionMode.Multiple;
- else
- lstProducts.SelectionMode = SelectionMode.Single;
- lstProducts.View = (ViewBase)this.FindResource(selectedItem.Tag);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement