void area_OnEditThis(object sender, EventArgs e)
        {
            Area areaToEdit = (sender as UserArea).MyArea;

            AreaSetting setting = new AreaSetting();

            setting.Area_name = (sender as UserArea).MyArea.Name;

            if (setting.ShowDialog() == true)
            {
                areaToEdit.Name = setting.Area_name;

                Refresh();
            }
        }
 private void AddArea(object sender, RoutedEventArgs e)
 {
     lock (_lock)
     {
         if (_areas == null)
             _areas = new List<Business.Area>();
         AreaSetting setting = new AreaSetting();
         if (setting.ShowDialog() == true)
         {
             string name = setting.Area_name;
             Area temp = new Area(name);
             _areas.Add(temp);//将Area类类型的变量添加到List表中
             //更新
             Refresh();
         }       
     }
 }
 private void AddArea(object sender, RoutedEventArgs e)
 {
     lock (_lock)
     {
         if (_areas == null)
         {
             _areas = new List <Business.Area>();
         }
         AreaSetting setting = new AreaSetting();
         if (setting.ShowDialog() == true)
         {
             string name = setting.Area_name;
             Area   temp = new Area(name);
             _areas.Add(temp);//将Area类类型的变量添加到List表中
             //更新
             Refresh();
         }
     }
 }
          void area_OnEditThis(object sender, EventArgs e)
        {

            Area areaToEdit = (sender as UserArea).MyArea;
         
            AreaSetting setting = new AreaSetting();
            setting.Area_name = (sender as UserArea).MyArea.Name;

            if (setting.ShowDialog() == true)
            {
                areaToEdit.Name = setting.Area_name;

                Refresh();
            }

        }