Skip to main content

ComponentReloadTarget

Struct ComponentReloadTarget 

Source
pub struct ComponentReloadTarget { /* private fields */ }
Expand description

Explicitly opt in for declarative content. Use with_refresh for cached references and application child subscriptions. The original component is never reconstructed. Root assignments can be claimed with the literal, static-resource and binding ownership methods. with_owned_resources and with_owned_styles claim inline Resources and Styles. with_owned_handlers claims routed XAML subscriptions.

Implementations§

Source§

impl ComponentReloadTarget

Source

pub fn with_dependencies( self, dependencies: impl IntoIterator<Item = String>, ) -> Self

Declares resources/styles outside the document’s inline includes, such as application resources consumed through StaticResource. Their revisions are prepared and committed in the same transaction as this target.

Source

pub fn content_control( root: &Ref<ContentControl>, uri: String, baseline: String, configuration: RuntimeXamlLoaderConfiguration, ) -> Self

Source

pub fn content_page( root: &Ref<ContentPage>, uri: String, baseline: String, configuration: RuntimeXamlLoaderConfiguration, ) -> Self

Source

pub fn with_refresh(self, refresh: Rc<dyn ComponentRefresh>) -> Self

Source

pub fn with_owned_resources(self) -> Self

Claims the current root Resources contributions immediately after population. Preserves later application keys; conflicting writes/provider ownership require restart. Use with_owned_styles for Styles; custom resource side effects need an adapter.

Source

pub fn with_owned_styles(self) -> Self

Claims the current inline styles and Styles.Resources after initial population. Later application style entries retain their identity/order.

Source

pub fn with_owned_handlers(self) -> Self

Claims routed XAML subscriptions from initial population. Framework metadata events without a removable token require an explicit adapter.

Source

pub fn with_state_adapter(self, adapter: Rc<dyn ControlStateAdapter>) -> Self

Add application state transfer for named/keyed replacement children. The preserved component root is not reconstructed or restored by this hook.

Source

pub fn with_owned_root_property<T: PropertyValue>( self, property: &'static StyledProperty<T>, ) -> Self

Claims XAML ownership of this literal root attribute. Call immediately after initial population, before application overrides. Binding/animation changes and externally changed values require restart. Custom property callbacks must support reversible assignment; no arbitrary user side effects are rolled back.

Source

pub fn with_owned_root_static_resource_property<T: PropertyValue>( self, property: &'static StyledProperty<T>, ) -> Self

Claims a root literal or StaticResource assignment, including Theme/Template. Re-resolves the candidate value on dependency revisions even when the markup attribute is unchanged. Call immediately after initial population. Dynamic resources, bindings and application overrides require another adapter or restart. Property callbacks must support reversible assignment.

Source

pub fn is_alive(&self) -> bool

Source

pub fn with_owned_root_binding_property<T: PropertyValue>( self, property: &'static StyledProperty<T>, ) -> Self

Claims a root literal or synchronous reflection/compiled binding. Register immediately after population, before application assignments. Preparation defers the candidate root binding and recreates it for the preserved root; its new namescope belongs to the candidate children. Custom binding kinds, delayed/asynchronous update modes and lifecycle properties need an adapter.

Trait Implementations§

Source§

impl ReloadTarget for ComponentReloadTarget

Source§

fn complete_pending_state(&self)

Complete state restoration from an earlier accepted revision at the UI boundary. Runs against accepted sources, before candidate resource previews or preparation. Custom adapters normally need only the default no-op.
Source§

fn documents(&self) -> Vec<String>

Includes transitive document dependencies. A target may refresh this list after each revision.
Source§

fn prepare( &self, sources: Rc<Sources>, ) -> Result<Box<dyn PreparedReload>, ReloadError>

Source§

fn resource_preparation( self: Rc<Self>, _sources: Rc<Sources>, ) -> Result<Option<ResourcePreparation>, ReloadError>

Resource owners provide a lazy preview before ordinary view preparation.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.