private void AddAdorner(EnemyCamp camp, AdornerLayer adornerLayer) { SimpleSquareAdorner adorner = new SimpleSquareAdorner(MapImage, camp); adorner.DataContext = Model; adorner.MouseUp += adorner_MouseUp; adornerLayer.Add(adorner); }
void adorner_MouseUp(object sender, MouseButtonEventArgs e) { SimpleSquareAdorner simpleSquareAdorner = sender as SimpleSquareAdorner; if (simpleSquareAdorner != null && !IsEditorMode) { m_selectedCamp = simpleSquareAdorner.Camp; DialogResult = true; Close(); } }