FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    XamlLight

    struct · ferroui-base · v0.5.0

    struct XamlLight
    

    A light of the object model (WinUI Microsoft.UI.Xaml.Media.XamlLight).

    A subclass gives the light an id (get_id) and creates its composition light when the light is connected to the element that holds it (on_connected), setting it with set_composition_light. The light then lights, in the subtree of that element:

    • the elements that target its id (add_target_element): their composition visuals are targets of the composition light, which lights their content;
    • the XAML brushes that target its id (add_target_brush): the scene lighting effects of those brushes receive the light.

    The composition light is in the coordinates of the element that holds it (its CoordinateSpace is the composition visual of that element).

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<XamlLight>
    

    Returns a strong reference to this object.

    Source

    get_id

    fn get_id(self: &Self) -> String
    

    GetId: the id the elements and brushes the light lights target.

    Source

    on_connected

    fn on_connected(self: &Self, new_element: &Visual)
    

    OnConnected: the light is in the Lights of new_element, which is in a visual tree.

    Source

    on_disconnected

    fn on_disconnected(self: &Self, old_element: &Visual)
    

    OnDisconnected: the light left old_element, or the element left its visual tree.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data.

    Source

    id

    fn id(self: &Self) -> String
    

    The id of the light (GetId).

    Source

    composition_light

    fn composition_light(self: &Self) -> Option<Rc<CompositionLight>>
    

    CompositionLight.

    Source

    set_composition_light

    fn set_composition_light(self: &Self, light: Option<Rc<CompositionLight>>)
    

    Sets the composition light (None removes it). While the light is connected, the composition light is bound to the element that holds it: its coordinate space is that element, and it lights the targets of the id of the light in its subtree.

    Source

    host

    fn host(self: &Self) -> Option<Ref<Visual>>
    

    The element whose Lights holds the light, while it is connected.

    Source

    is_connected

    fn is_connected(self: &Self) -> bool
    

    Whether the light is connected to an element.

    Source

    add_target_element

    fn add_target_element(id: &str, element: &Visual)
    

    AddTargetElement(id, element): the XAML lights of id id light element (its content and its subtree) where it is in the subtree of the element that holds them.

    Source

    remove_target_element

    fn remove_target_element(id: &str, element: &Visual)
    

    RemoveTargetElement(id, element).

    Source

    add_target_brush

    fn add_target_brush(id: &str, brush: &Rc<dyn IBrush>)
    

    AddTargetBrush(id, brush): the XAML lights of id id light brush where it is drawn in the subtree of the element that holds them. Only a XAML composition brush can be lit (its scene lighting effects receive the light); other brushes are left as they are.

    Source

    remove_target_brush

    fn remove_target_brush(id: &str, brush: &Rc<dyn IBrush>)
    

    RemoveTargetBrush(id, brush).

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.