using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;

namespace CollaborativePlatformMain.Form.MessageSubPage.AddImage
{
    /// <summary>
    /// AddImageForm.xaml 的交互逻辑
    /// </summary>
    public partial class AddImageForm : Window
    {
        /// <summary>
        /// 父级窗体
        /// </summary>
        public SeconLegendPage SeconLegendPage;

        /// <summary>
        /// 创建新文件夹分级
        /// </summary>
        public AddImageForm(SeconLegendPage seconLegendPage)
        {
            InitializeComponent();
            SeconLegendPage = seconLegendPage;
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string name = tb_legend.Text.ToString();
            if (name == null || name.Equals(string.Empty))
            {
                MessageBox.Show("文件夹名称不允许为空！");
                return;
            }
            SeconLegendPage.AddLegendMath(name);

            this.Close();
        }
    }
}
