| | |
| | | /// </summary> |
| | | public event Action<HydroGradingPropTreeViewModel> SelectedPropChangedEvent; |
| | | |
| | | //所有绑定列表 |
| | | private List<HydroGradingPropTreeViewModel> _allBindingList = null; |
| | | private Yw.Model.HydroModelInfo _hydro = null;//水力信息 |
| | | private List<HydroGradingPropTreeViewModel> _allBindingList = null;//所有绑定列表 |
| | | |
| | | /// <summary> |
| | | /// 初始化数据 |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void InitialData() |
| | | public void SetBindingData(Yw.Model.HydroModelInfo hydro) |
| | | { |
| | | if (hydro == null) |
| | | { |
| | | return; |
| | | } |
| | | _hydro = hydro; |
| | | _allBindingList = new List<HydroGradingPropTreeViewModel>(); |
| | | var dictCatalogList = HydroParterCatalogHelper.GetSimpleDict(); |
| | | dictCatalogList.ForEach(x => |
| | | var catalogDict = HydroGradingCatalogHelper.GetDict(hydro); |
| | | catalogDict?.ForEach(x => |
| | | { |
| | | _allBindingList.Add(new HydroGradingPropTreeViewModel(x.Key, x.Value)); |
| | | var dictPropList = HydroParterPropHelper.GetDict(x.Key); |
| | | dictPropList.ForEach(t => |
| | | var propDict = HydroGradingPropHelper.GetNameDict(x.Key); |
| | | propDict?.ForEach(t => |
| | | { |
| | | _allBindingList.Add(new HydroGradingPropTreeViewModel(x.Key, t.Key, t.Value)); |
| | | }); |
| | |
| | | }; |
| | | allTreeList.Add(treeModel); |
| | | }); |
| | | |
| | | |
| | | this.simpleTreeViewCtrl1.SetBindingData(allTreeList); |
| | | this.simpleTreeViewCtrl1.ExpandAll(); |