using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.ComponentModel;

namespace Platform.Controls.ComponentContainer
{
    /// <summary>
    /// ColorDialog.xaml 的交互逻辑
    /// </summary>
    [DesignTimeVisible(false)]
    public partial class ColorDialog : Window
    {
        #region 初始化
        public ColorDialog()
        {
            InitializeComponent();
        }
        #endregion

        #region 公共属性
        public Color SelectedColor
        {
            get { return colorPicker.SelectedColor; }
        }
        #endregion

        #region 私有方法
        /// <summary>
        /// Enter键关闭窗口
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                this.Close();
            }
        }

        /// <summary>
        /// 确定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
        }

        /// <summary>
        /// 取消
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
        }
        #endregion
    }
}
