コード例 #1
0
        private void AddAdorner(EnemyCamp camp, AdornerLayer adornerLayer)
        {
            SimpleSquareAdorner adorner = new SimpleSquareAdorner(MapImage, camp);

            adorner.DataContext = Model;
            adorner.MouseUp    += adorner_MouseUp;

            adornerLayer.Add(adorner);
        }
コード例 #2
0
        void adorner_MouseUp(object sender, MouseButtonEventArgs e)
        {
            SimpleSquareAdorner simpleSquareAdorner = sender as SimpleSquareAdorner;

            if (simpleSquareAdorner != null && !IsEditorMode)
            {
                m_selectedCamp = simpleSquareAdorner.Camp;
                DialogResult   = true;
                Close();
            }
        }