using System.Windows.Forms.Integration;
|
|
namespace Yw.WinFrmUI.Hydro
|
{
|
public partial class ViewerL3d2 : UserControl
|
{
|
public ViewerL3d2()
|
{
|
InitializeComponent();
|
}
|
|
#region 事件集合
|
|
/// <summary>
|
/// 选择改变事件
|
/// </summary>
|
public event Action<List<Yw.WpfUI.Hydro.VisualL3d>> SelectionChangedEvent;
|
|
#endregion
|
|
#region 私有字段
|
|
private Yw.WpfUI.Hydro.ViewerL3d _wpfViewer = null;//wpf控件
|
|
#endregion
|
|
|
//初始化wpf控件
|
private void InitialWpfControl()
|
{
|
_wpfViewer = new WpfUI.Hydro.ViewerL3d();
|
_wpfViewer.SelectionChangedEvent += (visuals) => this.SelectionChangedEvent?.Invoke(visuals);
|
var elementHost = new ElementHost();
|
elementHost.Dock = DockStyle.Fill;
|
elementHost.Child = _wpfViewer;
|
this.Controls.Clear();
|
this.Controls.Add(elementHost);
|
}
|
|
|
/// <summary>
|
/// 初始化
|
/// </summary>
|
public void Initial(Yw.WpfUI.Hydro.NetworkL3d nw)
|
{
|
InitialWpfControl();
|
_wpfViewer.Initial(nw);
|
}
|
|
|
|
}
|
}
|