Exemple #1
0
        private async void AddCarButtonClick(object sender, RoutedEventArgs e)
        {
            await _db.EngTypes.LoadAsync();

            var engTypes = await _db.EngTypes.ToArrayAsync();

            var addCarWindow = new AddCarWindow(engTypes, _db);

            if (addCarWindow.ShowDialog(this) == true)
            {
                ViewModel.Cars = await _db.Phones.ToArrayAsync();
            }
        }
Exemple #2
0
        private async void ChangeCarButtonClick(object sender, RoutedEventArgs e)
        {
            if (ViewModel.SelectedCar != null)
            {
                var engTypes = await _db.EngTypes.ToArrayAsync();

                var addCarWindow = new AddCarWindow(engTypes, _db, ViewModel.SelectedCar);
                if (addCarWindow.ShowDialog(this) == true)
                {
                    ViewModel.Cars = await _db.Phones.ToArrayAsync();
                }
            }
            else
            {
                var err = new ErrorWindow("Выберите автомобиль из списка!");
                err.ShowDialog(this);
            }
        }