tags:

views:

47

answers:

1

public class DA_ActivityType { public int Id { get; set; } public string Name { get; set; } }

public static List GetActivitytypes() { DataContext dbo = new DataContext(); IEnumerable activityTypes = from actType in dbo.ActivityTypes

                                                     select new DA_ActivityType
                                                     {
                                                         Id = actType.TypeId,
                                                         Name = actType.Name

                                                     };
        return activityTypes.ToList();
    }

//XAML Code

+1  A: 

Either:

<ComboBox x:Name="myCombo" />
myCombo.ItemsSource = GetMyCollection();

or :

<ComboBox ItemsSource="{Binding}" />
and one of the parent elements must have the DataContext = GetMyCollection();
PaN1C_Showt1Me