public WellSelectionDialog(int rows, int cols, string title, bool allowEmptySelectionList, ObservableCollection <Tuple <int, int> > wellList = null) { InitializeComponent(); vm = new WellSelectionDialog_ViewModel(); vm.DialogTitle = title; DataContext = vm; m_wellList = new ObservableCollection <Tuple <int, int> >(); if (wellList == null) { for (int r = 0; r < rows; r++) { for (int c = 0; c < cols; c++) { m_wellList.Add(Tuple.Create <int, int>(r, c)); } } } else { foreach (Tuple <int, int> well in wellList) { m_wellList.Add(well); } } WellControl.Init(rows, cols, m_wellList); WellControl.NewWellSetSelected += WellControl_NewWellSetSelected; m_accepted = false; }