using CollaborativePlatformMain.DFEntity.MessageSubUtil; using CollaborativePlatformMain.Form.MessageSubPage.AddImage; using CollaborativePlatformMain.Util; 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 { /// /// SeconLegendPage.xaml 的交互逻辑 /// public partial class SeconLegendPage : Page { public SeconLegendPage() { InitializeComponent(); } /// /// 文件夹名称 /// public List LegendEntities = new List(); private void Window_Loaded(object sender, RoutedEventArgs e) { LegendEntity legendEntity1 = new LegendEntity("门窗大样", @"/Image/folderImage.png"); LegendEntity legendEntity2 = new LegendEntity("家具", @"/Image/folderImage.png"); LegendEntity legendEntity3 = new LegendEntity("户型", @"/Image/folderImage.png"); LegendEntity legendEntity4 = new LegendEntity("墙体大样", @"/Image/folderImage.png"); LegendEntity legendEntity5 = new LegendEntity("新增", @"/Image/add.png"); LegendEntities.Add(legendEntity1); LegendEntities.Add(legendEntity2); LegendEntities.Add(legendEntity3); LegendEntities.Add(legendEntity4); LegendEntities.Add(legendEntity5); sv_legend.ItemsSource = null; sv_legend.ItemsSource = LegendEntities; } /// /// 最后的文件夹分级名字 /// public string lastLegendName = "sp_add1"; /// /// 最后个数命名序号 /// public int Num = 1; /// /// 新增文件夹分级 /// /// /// private void StackPanel_MouseDown(object sender, MouseButtonEventArgs e) { StackPanel stackPanel = sender as StackPanel; if (stackPanel == null) return; Label label = stackPanel.FindName("lb_legendName") as Label; if (label == null) return; if (label.Content.ToString() == "新增") { AddImageForm addImageForm = new AddImageForm(this); addImageForm.ShowDialog(); } else { } } /// /// 新增文件夹 /// /// public void AddLegendMath(string legendName) { //添加数据 LegendEntity legendEntity=new LegendEntity(legendName, @"/Image/folderImage.png"); int index = LegendEntities.Count - 1; LegendEntities.Insert(index, legendEntity); sv_legend.ItemsSource = null; sv_legend.ItemsSource = LegendEntities; } /// /// 点击事件 /// /// /// private void Border_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { } } }