コード例 #1
0
        private void buttonAddAspect_Click(object sender, RoutedEventArgs e)
        {
            var windowAddAspect = new AspectEditWindow();

            if (windowAddAspect.ShowDialog() == true)
            {
                _area.AddAspect(new Aspect(windowAddAspect.AspectName, windowAddAspect.Intensity), _side);
            }
            UpdateAll();
        }
コード例 #2
0
        private void dataGridAreaMenuEditAspect_Click(object sender, RoutedEventArgs e)
        {
            var selected = dataGridAspects.SelectedItem as MyAspect;

            if (selected == null)
            {
                return;
            }
            var windowAddAspect = new AspectEditWindow(selected);

            if (windowAddAspect.ShowDialog() == true)
            {
                if (selected.Name != windowAddAspect.AspectName)
                {
                    selected.Aspect.Name = windowAddAspect.AspectName;
                    UpdateAll();
                }
                selected.Aspect.Intensity = windowAddAspect.Intensity;
            }
        }