You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.3 KiB
41 lines
1.3 KiB
using Kingo.PluginServiceInterface; |
|
using System; |
|
using System.Collections.Generic; |
|
using System.IO; |
|
using System.Linq; |
|
using System.Windows.Controls; |
|
|
|
namespace Kingo.Plugin.SystemSetting.View.ViewSystemSetting |
|
{ |
|
/// <summary> |
|
/// ViewLayterAttributeSetting.xaml 的交互逻辑 |
|
/// </summary> |
|
public partial class ViewLayterAttributeSetting : UserControl |
|
{ |
|
public ViewLayterAttributeSetting() |
|
{ |
|
InitializeComponent(); |
|
|
|
lbTBList.SelectedIndex = 0; |
|
this.Loaded += (s, e) => |
|
{ |
|
lbTBList.ItemsSource = (lbTBList.ItemsSource as List<LayerCfg>).FindAll(x => x.FieldsCfg.Count > 0); |
|
}; |
|
} |
|
|
|
private void LbTBList_SelectionChanged(object sender, SelectionChangedEventArgs e) |
|
{ |
|
if (lbTBList.SelectedItem is LayerCfg) |
|
{ |
|
if ((lbTBList.SelectedItem as LayerCfg).FieldsCfg.Count == 0) |
|
lbTBList.SelectedItem = (lbTBList.ItemsSource as List<LayerCfg>).FirstOrDefault(x => x.FieldsCfg.Count > 0); |
|
treeList.ItemsSource = null; |
|
treeList.ItemsSource = (lbTBList.SelectedItem as LayerCfg).GetAllFields(); |
|
} |
|
else |
|
{ |
|
return; |
|
} |
|
} |
|
} |
|
} |