List<string>
private List<string> myComboBoxData =null; public List<string> MyComboBoxData { get { return this.myComboBoxData ; } set { this.myComboBoxData = value; base.OnPropertyChanged("MyComboBoxData "); } } public ViewModel(UserDetails view) { this.view = view; view.DataContext = this; getmyComboBoxData(); } private void getmyComboBoxData() { using (myEntities context = new myEntities()) { myComboBoxData = (from utype in context.usertypes select utype.TypeName).ToList<string>(); } }
<ComboBox ItemsSource="{Binding MyComboBoxData}" Height="23" HorizontalAlignment="Left" Margin="150,91,0,0" Name="mycomboBox" VerticalAlignment="Top" Width="120" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)