private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { string type = ""; if (type == "ConstPayoff") { UserControl ctrl = new ConstantPayoffCtrl(); ctrl.DataContext = new ConstantPayoffCtrlViewModel(); this.PayoffDetailCtrl_.Children.Add(ctrl); } }