FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ResourceInclude

    struct · ferroui-markup-xaml · v0.5.0

    struct ResourceInclude
    

    Loads a resource dictionary from a specified URL.

    The document is loaded the first time the resources are asked for.

    View source

    Members

    new

    fn new(base_uri: Option<url::Url>) -> Rc<Self>
    

    Initializes a new instance: base_uri is the URL of the document that contains the include, which a relative source is resolved against (UriRef::resolve).

    Source

    with_service_provider

    fn with_service_provider(service_provider: Rc<dyn IServiceProvider>) -> Rc<Self>
    

    Initializes a new instance with the service provider of the place the include is declared in.

    Source

    loaded

    fn loaded(self: &Self) -> Rc<dyn IResourceDictionary>
    

    The loaded resource dictionary; loads it on first use.

    Panics

    Panics if source is not set, if the document cannot be loaded or if it is not a resource dictionary. Use try_loaded to handle a document that cannot be loaded.

    Source

    try_loaded

    fn try_loaded(self: &Self) -> Result<Rc<dyn IResourceDictionary>, XamlLoadError>
    

    The loaded resource dictionary; loads it on first use. A missing source, a document that cannot be loaded and a document that is not a resource dictionary are errors.

    Source

    source

    fn source(self: &Self) -> Option<UriRef>
    

    The source URL: an absolute URL, or a reference relative to the base URI of the include.

    Source

    set_source

    fn set_source(self: &Self, value: Option<UriRef>)
    

    Source

    as_resource_provider

    fn as_resource_provider(self: &Self) -> Rc<dyn IResourceProvider>
    

    The include as the resource provider contract.

    Source

    as_theme_variant_provider

    fn as_theme_variant_provider(self: &Self) -> Rc<dyn IThemeVariantProvider>
    

    The include as the theme variant provider contract.

    Source

    Trait implementations

    Availability

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