public void OpenDatabaseExplorer()
        {
            CarWorkshopDBContext context          = new CarWorkshopDBContext();
            Repository           clientRepository = new Repository(context);

            ShellViewModel viewModel = new ShellViewModel(clientRepository);
            Shell          s1        = new Shell(viewModel);

            s1.Show();

            CarViewModel viewModel1 = new CarViewModel(clientRepository);
            CarsWindow   c1         = new CarsWindow(viewModel1);

            c1.Show();

            RepairViewModel viewModel2 = new RepairViewModel(clientRepository);
            RepairsWindow   r1         = new RepairsWindow(viewModel2);

            r1.Show();

            MechanicViewModel viewModel3 = new MechanicViewModel(clientRepository);
            MechanicsWindow   m1         = new MechanicsWindow(viewModel3);

            m1.Show();
        }
Exemplo n.º 2
0
 private void CarWindow_Show(object sender, MouseButtonEventArgs e)
 {
     if (_cartWindow == null)
     {
         _cartWindow = new CarsWindow();
         _cartWindow.Closed += (a, b) => _cartWindow = null;
         _cartWindow.Show();
     }
     else
     {
         _cartWindow.Activate();
     }
 }
Exemplo n.º 3
0
        private void CarsButton_Click(object sender, RoutedEventArgs e)
        {
            CarsWindow window = new CarsWindow(new CarsViewModel());

            window.Show();
        }