using System;
using System.Collections.Generic;
using System.Linq;
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_Demo
{
    public partial class DemoPromptBox 
        : UserControl
    {
        // --------------------------------------------------------------
        #region ** constructor

        public DemoPromptBox()
        {
            InitializeComponent();
            Caption = "PromptBox";
            Message = "Please enter your name:";
        }

        #endregion

        // --------------------------------------------------------------
        #region ** properties

        public string Message { get; set; }
        public string Caption { get; set; }
        public C1MessageBoxButton Buttons { get; set; }
        public C1MessageBoxIcon Icon { get; set; }

        #endregion

        // --------------------------------------------------------------
        #region ** events

        public event EventHandler BoxClosed;

        #endregion

        // --------------------------------------------------------------
        #region ** buttons

        private void CreateWindow_Click(object sender, RoutedEventArgs e)
        {
            C1PromptBox.Show(Message, Caption, this.HandleResult);
        }

        private void HandleResult(string input, MessageBoxResult result) 
        {
            if (BoxClosed != null)
                BoxClosed(this, new EventArgs() { });
        }

        #endregion
    }
}
