public LocationBoxView() { InitializeComponent(); popupViewModel = new PopupViewModel(); popupViewModel.LocationSelected += popupViewModel_LocationSelected; popupViewModel.LocationRemoved += popupViewModel_LocationRemoved; popup.DataContext = popupViewModel; locationBoxViewModel = new LocationBoxViewModel(); locationBoxViewModel.LocationSelected += locationBoxViewModel_LocationSelected; locationListBox.DataContext = locationBoxViewModel; Index = 0; }