Beispiel #1
0
        public ListDrive()
        {
            InitializeComponent();
            DataContext = new DriverViewModel();
            DriverViewModel driverViewModel = new DriverViewModel();

            count.Content = driverViewModel.CountObject();
        }
Beispiel #2
0
        private void TextBox_SelectionChanged(object sender, RoutedEventArgs e)
        {
            DataContext = new DriverViewModel();
            var list = new List <Drivers>();

            foreach (Drivers driver in ddt.Items)
            {
                if (driver.Name.Contains(DriverName.Text))
                {
                    list.Add(driver);
                }
            }

            DataContext = new DriverViewModel(list);

            count.Content = list.Count;
        }