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;

namespace WizardSample
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            // create wizard dialog
            WizardDialog w = new WizardDialog();

            // add page 0: intro
            w.Pages.Add(new IntroPage());

            // add page 1: license agreement
            ContentPage p = new ContentPage(new WizardPages.EULA());
            w.Pages.Add(p);

            // add page 2: destination folder
            p = new ContentPage();
            p.Content = new WizardPages.SelectFolder();
            w.Pages.Add(p);

            // add page 3: ready to install
            p = new ContentPage();
            p.Content = new WizardPages.ReadyToInstall();
            w.Pages.Add(p);

            // add page 4: installation progress
            p = new ContentPage();
            p.Content = new WizardPages.Installing();
            w.Pages.Add(p);

            // add page 5: installation complete
            p = new ContentPage();
            p.Content = new WizardPages.Complete();
            w.Pages.Add(p);

            // ready: show the dialog
            w.IsResizable = false;
            w.Header = "ComponentOne Silverlight Wizard";
            w.CenterOnScreen();
            w.Closed += new EventHandler(w_Closed);
            w.ShowModal();
        }
        void w_Closed(object sender, EventArgs e)
        {
            WizardDialog w = sender as WizardDialog;
            _tbResult.Text = w.Canceled
                ? "Installation was canceled."
                : "Installation successful!";
        }
    }
}
