public CardDrive() { InitializeComponent(); DataContext = new DriverCardViewModel(); DriverCardViewModel driverCardViewModel = new DriverCardViewModel(); Count.Content = driverCardViewModel.CountObject(); }
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { DataContext = new DriverCardViewModel(); var listLic = new List <DriversAndLicences>(); foreach (DriversAndLicences lic in list.Items) { if (lic.Name.Contains(LicName.Text)) { listLic.Add(lic); } } DataContext = new DriverCardViewModel(listLic); Count.Content = listLic.Count; }