Wpf 如何在MVVM中连接3DViewport
我已经在代码隐藏中构建了一个Model3DGroup,它工作正常,但现在我想将Model3DGroup移动到MVVM模式中的ModelView。Model3DGroup现在设置为ModelView中的属性。 所以我的问题是:如何更改下面的代码以将Model3DGroup绑定到Viewport3D控件Wpf 如何在MVVM中连接3DViewport,wpf,mvvm,Wpf,Mvvm,我已经在代码隐藏中构建了一个Model3DGroup,它工作正常,但现在我想将Model3DGroup移动到MVVM模式中的ModelView。Model3DGroup现在设置为ModelView中的属性。 所以我的问题是:如何更改下面的代码以将Model3DGroup绑定到Viewport3D控件 <Viewport3D Name="MainViewport" ClipToBounds="True" > &
<Viewport3D Name="MainViewport" ClipToBounds="True" >
<Viewport3D.Camera>
<PerspectiveCamera
FarPlaneDistance="100"
LookDirection="-11,-10,-9"
UpDirection="0,1,0"
NearPlaneDistance="1"
Position="11,10,9"
FieldOfView="70" />
</Viewport3D.Camera>
<ModelUIElement3D ></ModelUIElement3D>
<ModelVisual3D>>
<ModelVisual3D.Content>
<DirectionalLight
Color="White"
Direction="-2,-3,-1" />
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
>
谢谢你的帮助