private void Refresh_Clicked(object sender, RoutedEventArgs e) { Debug.WriteLine($"Button Clicked Refresh"); List <Person> pl = new List <Person>(); pl.Add(new Person(5, "E")); pl.Add(new Person(6, "So")); pl.Add(new Person(7, "Md")); pl.Add(new Person(8, "Af")); ComboViewModel cvm = this.DataContext as ComboViewModel; cvm.People = new ObservableCollection <Person>(pl); }
public MainWindow() { InitializeComponent(); DataContext = new ComboViewModel(); }