pub trait IResourceProvider: IResourceNode {
// Required methods
fn owner(&self) -> Option<ResourceHostRef>;
fn owner_changed(&self, handler: Rc<dyn Fn()>) -> Rc<dyn IDisposable>;
fn add_owner(&self, owner: &ResourceHostRef);
fn remove_owner(&self, owner: &ResourceHostRef);
// Provided method
fn as_object(&self) -> Option<&FerroObject> { ... }
}Expand description
Represents an object that can be queried for resources but does not appear in the logical tree.
The interface represented by this trait is implemented by resource dictionaries, styles and the like.
Required Methods§
Sourcefn owner(&self) -> Option<ResourceHostRef>
fn owner(&self) -> Option<ResourceHostRef>
The owner of the resource provider.
If the resource provider is, or is a child of, a resource dictionary or style that is hosted by an element, this is that element.
Sourcefn owner_changed(&self, handler: Rc<dyn Fn()>) -> Rc<dyn IDisposable>
fn owner_changed(&self, handler: Rc<dyn Fn()>) -> Rc<dyn IDisposable>
Raised when the owner of the resource provider changes.
Sourcefn add_owner(&self, owner: &ResourceHostRef)
fn add_owner(&self, owner: &ResourceHostRef)
Adds an owner to the resource provider.
Sourcefn remove_owner(&self, owner: &ResourceHostRef)
fn remove_owner(&self, owner: &ResourceHostRef)
Removes a resource provider owner.
Provided Methods§
Sourcefn as_object(&self) -> Option<&FerroObject>
fn as_object(&self) -> Option<&FerroObject>
The provider as an object, when it is a class instance. Used for identity comparison and type tests.
Trait Implementations§
Source§impl MarkupTyped for dyn IResourceProvider
impl MarkupTyped for dyn IResourceProvider
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Source§impl PartialEq for dyn IResourceProvider
Handles compare by identity (reference equality): two handles are equal
when they refer to the same object, whichever adapter they were made
from.
impl PartialEq for dyn IResourceProvider
Handles compare by identity (reference equality): two handles are equal when they refer to the same object, whichever adapter they were made from.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".