namespace HStation.WinFrmUI
|
{
|
public partial class HomeXhsProjectPage_Bak : DocumentPage
|
{
|
public HomeXhsProjectPage_Bak()
|
{
|
InitializeComponent();
|
this.layoutControl1.SetupLayoutControl();
|
this.PageTitle.Caption = "首页";
|
this.PageTitle.HeaderSvgImage = this.svgImg32[0];
|
this.PageTitle.SvgImageSize = new Size(24, 24);
|
this.PageTitle.AllowClose = false;
|
}
|
|
private Lazy<BLL.XhsProjectStd> _bllProjectStd = new(() => new BLL.XhsProjectStd());
|
private List<XhsProjectStdDto> _allProjectList = null;
|
|
/// <summary>
|
/// 初始化数据源
|
/// </summary>
|
public override async void InitialDataSource()
|
{
|
_allProjectList = await _bllProjectStd.Value.GetAll();
|
this.tileItemForProject.Text = (_allProjectList == null ? 0 : _allProjectList.Count).ToString();
|
this.mapViewProjectListContainer1.LoadCompletedEvent += MapViewProjectListContainer1_LoadCompletedEvent;
|
await this.mapViewProjectListContainer1.InitialContainer();
|
}
|
|
/// <summary>
|
/// 刷新数据
|
/// </summary>
|
public override async void RefreshData()
|
{
|
base.RefreshData();
|
_allProjectList = await _bllProjectStd.Value.GetAll();
|
this.tileItemForProject.Text = (_allProjectList == null ? 0 : _allProjectList.Count).ToString();
|
await this.mapViewProjectListContainer1.SetProjectList(_allProjectList);
|
this.homeXhsProjectTreeListCtrl1.SetBindingData(_allProjectList);
|
}
|
|
//地图加载完成
|
private async void MapViewProjectListContainer1_LoadCompletedEvent()
|
{
|
await this.mapViewProjectListContainer1.SetProjectList(_allProjectList);
|
this.homeXhsProjectTreeListCtrl1.SetBindingData(_allProjectList);
|
}
|
|
//选择项目事件
|
private async void homeXhsProjectTreeListCtrl1_SelectProjectEvent(XhsProjectStdDto obj)
|
{
|
await this.mapViewProjectListContainer1.SelectProject(obj.ID);
|
var vm = new HomeXhsProjectPropertyViewModel(obj);
|
this.homeXhsProjectPropertyCtrl1.SelectedObject = vm;
|
}
|
|
//导入完成事件
|
private void homeXhsProjectTreeListCtrl1_ImportProjectCompletedEvent(ImportXhsProjectViewModel obj)
|
{
|
RefreshData();
|
}
|
|
//跳转事件
|
private async void homeXhsProjectPropertyCtrl1_JumpDirectEvent(XhsProjectStdDto obj)
|
{
|
var guid = new PageGuid()
|
{
|
Modular = Yw.WinFrmUI.PageModular.Bimface,
|
MoudingType = Yw.WinFrmUI.Page.eMoudingType.Tab,
|
Function = Yw.WinFrmUI.PageFunction.ViewBimface3d,
|
TagName = $"{obj.ID}"
|
};
|
|
if (!IsExistPage(guid, true))
|
{
|
var page = new XhsSchemeMultiMgrPage_Bak();
|
await page.SetBindingData(obj.ID);
|
//var page = new XhsProjectSimulationMgrPage();
|
CreatePage(page, guid);
|
}
|
|
|
}
|
|
//刷新数据事件
|
private void homeXhsProjectTreeListCtrl1_RefreshDataEvent()
|
{
|
RefreshData();
|
}
|
}
|
}
|