Docs / UI

Glossary: ViewPort Style

The properties, methods and events of ViewPort, in alphabetical order.

Color legend plain property dependency property method

Reserves a rectangle in the layout and runs your own drawing code inside it, for a 3D scene, a minimap or any other render embedded in the UI.

ViewPort derives from BaseElement and has its members too. The images page shows it in context, with code and screenshots.

Names are colored by what they are: a plain property, a method, an event or a dependency property, which a style, a binding or an animation can set.

Properties

DeviceBounds 🠆

Rectangle · Read-only. The view port’s bounds in device pixels, the rectangle GraphicsDevice.Viewport is set to. It can be read outside the draw instructions too, for example for a camera’s aspect ratio.

DrawInstructions 🠆

Action · Your drawing code, run every frame inside the view port, over its background and under its children, as described above.

GeneralMouseCursorsSet 🠆

MouseCursorsSet · Static. The cursors of every element of this style type; null (the default) falls back to DefaultMouseCursorsSet.

GeneralStyle 🠆

ViewPortStyle · Static. The style of every element of this style type. It starts as a copy of the framework defaults; changing one of its properties updates every such element, a property it leaves unset takes its default.

MaxDepth 🠆

float · The maximum depth of the viewport’s depth range. Defaults to DefaultSettings.DefaultMaxDepth (1).

MinDepth 🠆

float · The minimum depth of the viewport’s depth range. Defaults to DefaultSettings.DefaultMinDepth (0).

MouseCursorsSet 🠆

MouseCursorsSet · Read-only. The cursors the element shows: its override, else the set given to the control it is a part of, else its type’s general set, else DefaultMouseCursorsSet.

MouseCursorsSetOverride 🠆

MouseCursorsSet · The cursors of this element only, passed on to its parts that have none of their own.

StyleOverride 🠆

ViewPortStyle · A style for this element only, applied over the general style. Setting it to null takes its values back out.

Methods

ViewPort() 🠆

ViewPort(string name = null) · Creates a view port. The name is used by GetElementByName.

Parameter Type Description
name string The element’s Name, which GetElementByName finds it by. Default: null.