Beispiel #1
0
        public SingleChargeSolver()
        {
            InitializeComponent();
            Instance = this;

            for (int i = 0; i < 9; i++)
            {
                for (int j = 0; j < 6; j++)
                {
                    var newfPoint = new FieldVector
                    {
                        Height = 14,
                        Width  = 8,
                        HorizontalAlignment = HorizontalAlignment.Left,
                        VerticalAlignment   = VerticalAlignment.Top,
                        Margin = new Thickness((45 * i) + 21, (45 * j) + 12, 0, 0)
                    };
                    gridField.Children.Add(newfPoint);
                }
            }

            var group = new TransformGroup();

            var transfer = new TranslateTransform
            {
                X = 190,
                Y = 118
            };

            group.Children.Add(transfer);
            positiveCharge1.RenderTransform = group;

            _charges.Add(positiveCharge1.MyCharge);
            CalculatePositions();
        }
        public SingleChargeSolver()
        {
            InitializeComponent();
            Instance = this;

            for (int i = 0; i < 9; i++)
            {
                for (int j = 0; j < 6; j++)
                {
                    var newfPoint = new FieldVector
                                        {
                                            Height = 14,
                                            Width = 8,
                                            HorizontalAlignment = HorizontalAlignment.Left,
                                            VerticalAlignment = VerticalAlignment.Top,
                                            Margin = new Thickness((45*i) + 21, (45*j) + 12, 0, 0)
                                        };
                    gridField.Children.Add(newfPoint);
                }
            }

            var group = new TransformGroup();

            var transfer = new TranslateTransform
                               {
                                   X = 190,
                                   Y = 118
                               };

            group.Children.Add(transfer);
            positiveCharge1.RenderTransform = group;

            _charges.Add(positiveCharge1.MyCharge);
            CalculatePositions();
        }
 private void MunItemSingleSolverClick(object sender, RoutedEventArgs e)
 {
     var scs = new SingleChargeSolver();
     scs.Show();
 }