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

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

            // Unmarkierte CheckBox in Code Behind
            CheckBox checkBox1 = new CheckBox();            
            checkBox1.Height = 72;
            checkBox1.Width = 444;
            checkBox1.Margin = new System.Windows.Thickness(24, 18, 0, 0);
            checkBox1.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            checkBox1.VerticalAlignment = System.Windows.VerticalAlignment.Top;
            checkBox1.Content = "Unmarkierte CheckBox";

            // Markierte CheckBox in Code Behind
            CheckBox checkBox2 = new CheckBox();
            checkBox2.Height = 72;
            checkBox2.Width = 444;
            checkBox2.Margin = new System.Windows.Thickness(24, 96, 0, 0);
            checkBox2.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;            
            checkBox2.VerticalAlignment = System.Windows.VerticalAlignment.Top;           
            checkBox2.Content = "Markierte CheckBox";
            checkBox2.IsChecked = true;

            // Teilmarkierte CheckBox in Code Behind
            CheckBox checkBox3 = new CheckBox();
            checkBox3.Height = 72;
            checkBox3.Width = 444;
            checkBox3.Margin = new System.Windows.Thickness(24, 174, 0, 0);
            checkBox3.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            checkBox3.VerticalAlignment = System.Windows.VerticalAlignment.Top;            
            checkBox3.Content = "Teilmarkierte CheckBox";
            checkBox3.IsChecked = null;
            checkBox3.IsThreeState = true;

            // CheckBox dem Grid hinzufügen
            ContentGrid.Children.Add(checkBox1);
            ContentGrid.Children.Add(checkBox2);
            ContentGrid.Children.Add(checkBox3);
        }
    }
}