using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Ch07Sample_03
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int level = 0;
            //注意：索引值是从零开始的
            level = comboBox1.SelectedIndex + 1;
          
           
            switch (level)
            {
                case 3:
                    txtResult.Text = "资深专员";
                    break;
                case 2:
                    txtResult.Text = "专员";
                    break;
                default:
                    txtResult.Text = "新进专员";
                    break;
            }
        }
    }
}
