Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using WPF and C#, I have a class called AirLines with enum Meal to represent radio buttons in WPF. I need to insert new Airlines
Using WPF and C#, I have a class called AirLines with enum Meal to represent radio buttons in WPF. I need to insert new Airlines and I have a problem because the constructor in Airlines class need to get the value from the enum Mealavailable while in WPF I need to get the value from a text box generated from the selected radio buttons. how to get this value ?
plorer General } } 50 51 52 53 54 55 56 57 58 59 60 == 11 II 1 61 private void MTInsert_Click(object sender, RoutedEventArgs e) { if (txtName.Text || txtSeat.Text == II textMeal.Text == || textAir.Text == ) { MessageBox.Show("No text box can be empty", "Error", MessageBoxButton.OK, MessageBoxImage. Error); } else { airlines.Add(new Airlines (airlines.Count, txtName.Text, Int32.Parse(txtSeat.Text), Airlines. textAir.Text(1stAir_SelectionChanged) )); 62 63 64 65 66 67 68 69 95 % X 3 ! 0 + Ln: 61 Ch: 69 SPC CRLF Error List X Entire Solution X3 Errors ! O Warnings A 25 Messages X Build + IntelliSense Search Error List Eplorer General { } 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 public enum MealAvialable { Chicken, Meat, Veggie } public enum Airplane { Boeing_787, Boeing 747, Airbus_A320 } private int Airlines_ID; private string Airline_name; private int SeatsAvailable; private MealAvialable _MealAvilable; private Airplane _Airplane; public Airlines(int i, string n, int s, MealAvialable m, Airplane a) { Airlines_ID = i; No issues found 95 % Ln: 30 Ch: 66 SPC CRLF Error List wwwwwwwwwwwwwwwwwwwww wwwwwww X [Window] Explorer [Windon 1 o o o oStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started