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;
using C1.Silverlight.Theming;

namespace ThemingC1Window
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();

            propertygrid.SelectedObject = new MyObject();

            // apply the resources to the popup used by the C1Window (and C1MessageBox)
            C1Window.ThemeResources = theme.GetNewResourceDictionary();
        }

        private void btnOpenWindow_Click(object sender, RoutedEventArgs e)
        {
            var window = new C1Window();

            //window.Style = (Style)theme.Resources[typeof(C1Window)];
            window.Header = "Window Header";
            window.Content = new TextBlock()
            {
                Text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
                TextWrapping = TextWrapping.Wrap,
                Margin = new Thickness(30)
            };
            window.Height = 400;
            window.Width = 600;
            window.Show();
            window.CenterOnScreen();
        }

        private void btnOpenMessageBox_Click(object sender, RoutedEventArgs e)
        {
            //C1MessageBox.WindowStyle = (Style)theme.Resources[typeof(C1Window)];
            //C1MessageBox.ContentStyle = (Style)theme.Resources[typeof(C1MessageBoxContent)];
            C1MessageBox.Show("Simple message box");
        }
    }
}
