using System.Windows;
using System.Windows.Controls;
using Microsoft.Phone.Controls;

namespace Controls.Pages
{
    public partial class GridPage : PhoneApplicationPage
    {
        public GridPage()
        {
            InitializeComponent();

            //// Grid mit 3 Spalten und 5 Zeilen erstellen
            //Grid grid1 = new Grid();
            //grid1.Height = 501;
            //grid1.Width = 444;
            //grid1.Margin = new Thickness(24, 27, 0, 0);
            //grid1.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            //grid1.VerticalAlignment = System.Windows.VerticalAlignment.Top;
            //grid1.ShowGridLines = true;

            //// Spalten definieren und dem Grid hinzufügen
            //ColumnDefinition columnDefStar1 = new ColumnDefinition();
            //columnDefStar1.Width = new GridLength(30,GridUnitType.Star);
            //ColumnDefinition columnDefStar2 = new ColumnDefinition();
            //columnDefStar2.Width = new GridLength(30, GridUnitType.Star);
            //ColumnDefinition columnDefPixel = new ColumnDefinition();
            //columnDefPixel.Width = new GridLength(140,GridUnitType.Pixel);

            //grid1.ColumnDefinitions.Add(columnDefStar1);
            //grid1.ColumnDefinitions.Add(columnDefPixel);
            //grid1.ColumnDefinitions.Add(columnDefStar2);

            //// Reihen definieren und dem Grid hinzufügen
            //var rowHeight = 50;

            //for (int i = 0; i < 5; i++)
            //{
            //    RowDefinition rowDef = new RowDefinition();
            //    rowDef.Height = new GridLength(50);
            //    rowHeight += 25;
            //    grid1.RowDefinitions.Add(rowDef);
            //}

            //// Jeder Zelle einen Textblock mit Reihen- und Zeilenangabe hinzufügen
            //for (int i = 0; i < 3; i++)
            //{
            //    for (int j = 0; j < 5; j++)
            //    {
            //        TextBlock cellText = new TextBlock();
            //        cellText.TextWrapping = TextWrapping.Wrap;
            //        cellText.Text = "Spalte " + i + " Zeile " + j;
            //        Grid.SetColumn(cellText, i);
            //        Grid.SetRow(cellText, j);
            //        grid1.Children.Add(cellText);

            //    }
                
            //}

            //// Grid dem Grid hinzufügen
            //ContentGrid.Children.Add(grid1);
        }
    }
}