Click or drag to resize
AB4D logo

BaseUIElement3DRefresh Method

Recreates the Model3D used to display this UIElement3D.

Namespace: Ab3d.UIElements
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public void Refresh()
Remarks

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.

Example

The following example shows how to create wireframe from SphereUIElement3D.

C#
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);
See Also