private void Window_Loaded(object sender, RoutedEventArgs e) { //Cвязывание ComboBox c Position ParserJSON pj = new ParserJSON(); string resultPosition = pj.GetPosition(); PositionObject po = JsonConvert.DeserializeObject <PositionObject>(resultPosition); Cb_Position.ItemsSource = po.positions; Cb_Position.DisplayMemberPath = "position_name"; }
private void Window_Loaded(object sender, RoutedEventArgs e) { try { ParserJSON pj = new ParserJSON(); //Cвязывание ComboBox c Position string resultPosition = pj.GetPosition(); PositionObject po = JsonConvert.DeserializeObject <PositionObject>(resultPosition); Cb_Position.ItemsSource = po.positions; Cb_Position.DisplayMemberPath = "position_name"; string resultPatient = pj.GetPatient(); RadicalObject ro = JsonConvert.DeserializeObject <RadicalObject>(resultPatient); Cb_Patient.ItemsSource = ro.patients; Cb_Patient.DisplayMemberPath = "fio"; } catch (Exception) { } }