private void pbAdd_Click(object sender, EventArgs e) { var postFilterVM = new PostFilterItemViewModel(); var postFilterItem = new PostFilterItemView { ViewModel = postFilterVM }; ViewModel.AddFilterItems(postFilterVM); postFilterPanel.Controls.Add(postFilterItem); subscribeToControlEvents(postFilterItem); }
private void subscribeToControlEvents(PostFilterItemView filterItem) { filterItem.DeleteClicked += deleteClicked; }