void printNeurons(Neuron[] vector, int n)
 {
     int i = 0;
     foreach (Neuron el in vector)
     {
         textBlock1.Text += el.getActivationState() + "\t";
         i++;
         if (i % n == 0) textBlock1.Text += "\n";
     }
 }
        void drawNeurons(Neuron[] vector, int n)
        {
            neuronsWisualization.Children.Clear();
            if (Network.neuronEnum != null)
            {
                if (neuronsWisualization.ActualHeight > 0 && neuronsWisualization.ActualWidth > 0)
                {
                    int tileSize = getTileSize(n, neuronsWisualization);
                    // Ustaw marginesy
                    int startY = (int)(neuronsWisualization.ActualHeight - n * tileSize) / 2;
                    int startX = (int)(neuronsWisualization.ActualWidth - n * tileSize) / 2;
                    int x = 0;
                    int y = 0;
                    int i = 0;
                    foreach (var el in vector)
                    {
                        SolidColorBrush brush = new SolidColorBrush();
                        brush.Color = getColorFromWeight(el.getActivationState());

                        Border tile = new Border()
                        {
                            BorderBrush = Brushes.Black,
                            BorderThickness = new Thickness((Network.neurons[Network.current_neuron].getId() == i && editMode == false ? 2 : 1)),
                            Background = brush,
                            Width = tileSize,
                            Height = tileSize,
                            Uid = i.ToString()
                        };
                        tile.PreviewMouseDown += przelaczStan;

                        tile.Child = new TextBlock()
                        {
                            Text = String.Format("{0:n0}", el.getActivationState()),
                            HorizontalAlignment =
                            HorizontalAlignment.Center,
                            VerticalAlignment =
                            VerticalAlignment.Center,
                            FontWeight = (Network.neurons[Network.current_neuron].getId() == i && editMode == false ? FontWeights.ExtraBold : FontWeights.Normal)
                        };
                        ;

                        neuronsWisualization.Children.Add(tile);

                        Canvas.SetTop(tile, startY + tileSize * y - 1);
                        Canvas.SetLeft(tile, startX + tileSize * x - 1);

                        // Oblicz wsp dla rysowanych komórek
                        i++;
                        x++;
                        if (i % n == 0)
                        {
                            y++;
                            x = 0;
                        }
                    }
                }
            }
        }