Base |
public void Refresh()
When UIElement3D is created in code and it is added to Viewport3D, the Model3D is automatically created on first rendering pass of WPF. However if the UIElement3D is not added to Viewport3D, the geometry is never created.
To force creation of geometry, call Refresh method. This can be useful when the UIElement3D is used to create a Wireframe model.
The following example shows how to create wireframe from SphereUIElement3D.
Ab3d.UIElements.SphereUIElement3D sphere; sphere = new Ab3d.UIElements.SphereUIElement3D(); sphere.Radius = 200; sphere.Material = new DiffuseMaterial(Brushes.Red); sphere.Refresh(); // Creates the Model3D Ab3d.Models.WireframeFactory.CreateWireframe(sphere, 1, true, Colors.Black, Viewport1);