using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using C1.Silverlight;

namespace C1_DemoLocalization2010
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            _buttons.Items.Add(C1MessageBoxButton.OK);
            _buttons.Items.Add(C1MessageBoxButton.OKCancel);
            _buttons.Items.Add(C1MessageBoxButton.YesNo);
            _buttons.Items.Add(C1MessageBoxButton.YesNoCancel);

            _boxType.Items.Add("C1MessageBox");
            _boxType.Items.Add("C1PromptBox");

            _boxType.SelectedIndex = 0;
            _buttons.SelectedIndex = 3;
        }

        private void CreateBox_Click(object sender, RoutedEventArgs e)
        {

            if (_boxType.SelectedItem != null && _boxType.SelectedItem.Equals("C1PromptBox"))
            {
                C1PromptBox.Show("This is a prompt box!", "Alert", null);
            }
            else
            {
                C1MessageBoxButton button = (C1MessageBoxButton)(_buttons.SelectedItem ?? C1MessageBoxButton.OK);
                C1MessageBox.Show("This is a message box!", "Alert", button);
            }
        }
    }
}
