private void Grid_Loaded(object sender, RoutedEventArgs e) { try { CategoryTransport.ItemsSource = LogicCategoryTransport.GetNameCategory(); TypeOfDrive.ItemsSource = LogicTypeOfDrive.GetNameType(); TransportModel transport = LogicTransport.GetCurrentTransport(); Manufacturer.Text = transport.Manufacturer; Model.Text = transport.Model; YearTransport.Text = transport.YearTransport; NumberEngine.Text = transport.NumberEngine; ModelEngine.Text = transport.ModelEngine; YearEngine.Text = transport.YearEngine; PowerEngineK.Text = transport.PowerEngineKVT; PowerEngineH.Text = transport.PowerEngineH; MaxLoad.Text = transport.MaxLoad.ToString(); Weight.Text = transport.Weight.ToString(); Color.Text = transport.Color; VIN.Text = transport.VIN; Description.Text = transport.Description; CategoryTransport.SelectedIndex = transport.CategoryTransport - 1; TypeOfDrive.SelectedIndex = transport.TypeOfDrive - 1; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Grid_Loaded(object sender, RoutedEventArgs e) { CategoryTransport.ItemsSource = LogicCategoryTransport.GetNameCategory(); TypeOfDrive.ItemsSource = LogicTypeOfDrive.GetNameType(); }