namespace HStation.WinFrmUI
|
{
|
public partial class XhsProjectResultBimfaceCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public XhsProjectResultBimfaceCtrl()
|
{
|
InitializeComponent();
|
this.bimfaceInterop3dContainer1.LoadCompletedEvent += BimfaceInterop3dContainer1_LoadCompletedEvent;
|
}
|
|
private ImportXhsProjectViewModel _vm = null;//操作对象
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public async void SetBindingData(ImportXhsProjectViewModel vm)
|
{
|
if (vm == null)
|
{
|
return;
|
}
|
_vm = vm;
|
await this.bimfaceInterop3dContainer1.InitialContainer();
|
}
|
|
//页面加载完成后触发
|
private async void BimfaceInterop3dContainer1_LoadCompletedEvent()
|
{
|
if (_vm == null)
|
{
|
return;
|
}
|
if (_vm.BimfaceFile == null)
|
{
|
return;
|
}
|
|
var viewToken = await BimfaceHelper.GetViewToken(_vm.BimfaceFile.BimfaceId);
|
if (string.IsNullOrEmpty(viewToken))
|
{
|
return;
|
}
|
await this.bimfaceInterop3dContainer1.LoadView(viewToken);
|
}
|
|
|
}
|
}
|