pub struct Application { /* private fields */ }Expand description
Encapsulates a FerroUI application.
The Application class encapsulates application-specific
functionality, including:
- A global set of
data_templates. - A global set of
styles. - An input manager.
- Registers services needed by the rest of the framework in the
register_servicesmethod. - Tracks the lifetime of the application.
An application class derives from it and overrides the members of
ApplicationImpl:
#[repr(C)]
pub struct App { base: Application }
ferro_class!(App: Application);
ferro_impl_classes!(App: FerroObjectImpl);
impl ApplicationImpl for App {
fn initialize(this: &Self) {
this.styles().add(theme());
}
}
impl NewApplication for App {
fn new_application() -> Ref<Self> {
instantiate(Self { base: Application::construct() })
}
}Implementations§
Source§impl Application
impl Application
Source§impl Application
impl Application
Sourcepub fn initialize(&self)
pub fn initialize(&self)
Initializes the application by loading its styles and resources.
Sourcepub fn register_services(&self)
pub fn register_services(&self)
Registers the services needed by the framework.
Sourcepub fn on_framework_initialization_completed(&self)
pub fn on_framework_initialization_completed(&self)
Called when the framework has completed its initialization: the place to create the main window or view of the lifetime.
Source§impl Application
impl Application
Sourcepub fn data_context_property() -> &'static StyledProperty<Option<BoxedValue>>
pub fn data_context_property() -> &'static StyledProperty<Option<BoxedValue>>
Defines the DataContext property.
Sourcepub fn actual_theme_variant_property() -> &'static StyledProperty<Option<ThemeVariant>>
pub fn actual_theme_variant_property() -> &'static StyledProperty<Option<ThemeVariant>>
Defines the ActualThemeVariant property: the UI theme variant
that is currently used by the application.
Sourcepub fn requested_theme_variant_property() -> &'static StyledProperty<Option<ThemeVariant>>
pub fn requested_theme_variant_property() -> &'static StyledProperty<Option<ThemeVariant>>
Defines the RequestedThemeVariant property: the UI theme
variant that is requested for the application.
Sourcepub fn name_property() -> &'static DirectProperty<Application, Option<String>>
pub fn name_property() -> &'static DirectProperty<Application, Option<String>>
Defines the Name property.
Source§impl Application
impl Application
Sourcepub fn construct() -> Self
pub fn construct() -> Self
Creates the class data; see FerroObject::construct.
Sourcepub fn new() -> Ref<Self>
pub fn new() -> Ref<Self>
Creates an instance of the Application class.
Sourcepub fn data_context(&self) -> Option<BoxedValue>
pub fn data_context(&self) -> Option<BoxedValue>
The application’s data context.
The data context property specifies the default object that will be used for data binding.
Sourcepub fn set_data_context(&self, value: Option<BoxedValue>)
pub fn set_data_context(&self, value: Option<BoxedValue>)
Sets the application’s data context.
Sourcepub fn requested_theme_variant(&self) -> Option<ThemeVariant>
pub fn requested_theme_variant(&self) -> Option<ThemeVariant>
The UI theme variant that is requested for the application.
Sourcepub fn set_requested_theme_variant(&self, value: Option<ThemeVariant>)
pub fn set_requested_theme_variant(&self, value: Option<ThemeVariant>)
Sets the UI theme variant that is requested for the application.
Sourcepub fn actual_theme_variant(&self) -> Option<ThemeVariant>
pub fn actual_theme_variant(&self) -> Option<ThemeVariant>
The UI theme variant that is currently used by the application.
None until the services of the application have been registered.
Sourcepub fn is_theme_variant_root(&self) -> bool
pub fn is_theme_variant_root(&self) -> bool
The application is the root of the theme variant resolution.
Sourcepub fn current() -> Option<Ref<Application>>
pub fn current() -> Option<Ref<Application>>
The current instance of the Application class: the application
registered with the service locator (see
bind_current).
Sourcepub fn bind_current(application: Ref<Application>)
pub fn bind_current(application: Ref<Application>)
Registers application with the current service locator as the
application returned by current.
Sourcepub fn data_templates(&self) -> DataTemplates
pub fn data_templates(&self) -> DataTemplates
The application’s global data templates.
Sourcepub fn is_data_templates_initialized(&self) -> bool
pub fn is_data_templates_initialized(&self) -> bool
Whether the data templates collection has been created.
Sourcepub fn input_manager(&self) -> Option<Rc<InputManager>>
pub fn input_manager(&self) -> Option<Rc<InputManager>>
The application’s input manager, once the services have been registered.
Sourcepub fn resources(&self) -> Ref<ResourceDictionary>
pub fn resources(&self) -> Ref<ResourceDictionary>
The application’s global resource dictionary.
Sourcepub fn set_resources(&self, value: Ref<ResourceDictionary>)
pub fn set_resources(&self, value: Ref<ResourceDictionary>)
Sets the application’s global resource dictionary.
Sourcepub fn styles(&self) -> Ref<Styles>
pub fn styles(&self) -> Ref<Styles>
The application’s global styles.
Global styles apply to all windows in the application.
Sourcepub fn is_styles_initialized(&self) -> bool
pub fn is_styles_initialized(&self) -> bool
Whether the styles collection has been created.
Sourcepub fn has_resources(&self) -> bool
pub fn has_resources(&self) -> bool
Whether the application or its styles have resources.
Sourcepub fn styling_parent(&self) -> Option<StyleHostRef>
pub fn styling_parent(&self) -> Option<StyleHostRef>
The styling parent of the application, which is None.
Sourcepub fn application_lifetime(&self) -> Option<Rc<dyn IApplicationLifetime>>
pub fn application_lifetime(&self) -> Option<Rc<dyn IApplicationLifetime>>
The application lifetime; use it for things like setting the main window or view and exiting the application from code.
Sourcepub fn set_application_lifetime(
&self,
value: Option<Rc<dyn IApplicationLifetime>>,
)
pub fn set_application_lifetime( &self, value: Option<Rc<dyn IApplicationLifetime>>, )
Sourcepub fn platform_settings(&self) -> Option<Rc<dyn IPlatformSettings>>
pub fn platform_settings(&self) -> Option<Rc<dyn IPlatformSettings>>
The contract for accessing global platform-specific settings.
It can be None only if the application wasn’t initialized yet. The
platform settings of a top-level are an equivalent which should
always be preferred over the global one, as specific top-levels
might have different settings set up.
Sourcepub fn resources_changed(
&self,
handler: impl Fn(&ResourcesChangedEventArgs) + 'static,
) -> Rc<dyn IDisposable>
pub fn resources_changed( &self, handler: impl Fn(&ResourcesChangedEventArgs) + 'static, ) -> Rc<dyn IDisposable>
Raised when the resources of the application change. Disposing the returned handle unsubscribes.
Sourcepub fn actual_theme_variant_changed(
&self,
handler: impl Fn() + 'static,
) -> Rc<dyn IDisposable>
pub fn actual_theme_variant_changed( &self, handler: impl Fn() + 'static, ) -> Rc<dyn IDisposable>
Raised when the actual theme variant of the application has changed. Disposing the returned handle unsubscribes.
Sourcepub fn try_get_resource(
&self,
key: &ResourceKey,
theme: Option<&ThemeVariant>,
) -> Option<ResourceValue>
pub fn try_get_resource( &self, key: &ResourceKey, theme: Option<&ThemeVariant>, ) -> Option<ResourceValue>
Tries to find a resource within the application: in its resource dictionary, then in its styles.
Sourcepub fn name(&self) -> Option<String>
pub fn name(&self) -> Option<String>
The application name to be used for various platform-specific purposes.
Sourcepub fn try_get_feature(&self, feature_type: TypeId) -> Option<Rc<dyn Any>>
pub fn try_get_feature(&self, feature_type: TypeId) -> Option<Rc<dyn Any>>
Queries for an optional feature.
feature_type is the TypeId of the feature’s trait object type;
the returned value holds the Rc<dyn ..> handle of the feature.
Features currently supported:
dyn IPlatformSettingsdyn IActivatableLifetime
Sourcepub fn try_get<T: ?Sized + 'static>(&self) -> Option<Rc<T>>
pub fn try_get<T: ?Sized + 'static>(&self) -> Option<Rc<T>>
Queries for an optional feature registered as Rc<T>; see
try_get_feature.
Sourcepub fn initialize_theme_variant(&self)
pub fn initialize_theme_variant(&self)
Establishes the actual theme variant of the application and keeps it up to date with the color values of the platform settings.
The subscription lasts as long as the platform settings do; it does not keep the application alive.
Sourcepub fn as_global_styles(&self) -> Rc<dyn IGlobalStyles>
pub fn as_global_styles(&self) -> Rc<dyn IGlobalStyles>
The application as the host of the global styles.
Sourcepub fn as_style_host(&self) -> Rc<dyn IStyleHost>
pub fn as_style_host(&self) -> Rc<dyn IStyleHost>
The application as a style host.
Sourcepub fn as_resource_host(&self) -> Rc<dyn IResourceHost>
pub fn as_resource_host(&self) -> Rc<dyn IResourceHost>
The application as a resource host.
Sourcepub fn as_theme_variant_host(&self) -> Rc<dyn IThemeVariantHost>
pub fn as_theme_variant_host(&self) -> Rc<dyn IThemeVariantHost>
The application as a theme variant host.
Sourcepub fn as_global_data_templates(&self) -> Rc<dyn IGlobalDataTemplates>
pub fn as_global_data_templates(&self) -> Rc<dyn IGlobalDataTemplates>
The application as the host of the global data templates.
Sourcepub fn as_optional_feature_provider(&self) -> Rc<dyn IOptionalFeatureProvider>
pub fn as_optional_feature_provider(&self) -> Rc<dyn IOptionalFeatureProvider>
The application as a provider of optional features.
Sourcepub fn as_theme_variant_root(&self) -> Rc<dyn IThemeVariantRoot>
pub fn as_theme_variant_root(&self) -> Rc<dyn IThemeVariantRoot>
The application as a theme variant root.
Sourcepub fn as_data_context_provider(&self) -> Rc<dyn IDataContextProvider>
pub fn as_data_context_provider(&self) -> Rc<dyn IDataContextProvider>
The application as an element with a data context that can be used for binding.
Source§impl Application
impl Application
Sourcepub fn run(&self, closable: &dyn ICloseable)
pub fn run(&self, closable: &dyn ICloseable)
On desktop-style platforms runs the application’s main loop until
closable is closed.
Consider using a classic desktop lifetime instead. Without run loops this returns right after subscribing to the closed event.
Sourcepub fn run_window(&self, main_window: impl Into<Nullable<Window>>)
pub fn run_window(&self, main_window: impl Into<Nullable<Window>>)
On desktop-style platforms runs the application’s main loop until the main window is closed. The window is shown if it is not visible.
Consider using a classic desktop lifetime instead. Without run loops this returns right after showing the window, which stays alive until it is closed.
§Panics
Panics when main_window is null.
Sourcepub fn run_with_token(&self, token: &CancellationToken)
pub fn run_with_token(&self, token: &CancellationToken)
On desktop-style platforms runs the application’s main loop with a
custom cancellation token, without setting a lifetime: the loop runs
until token is canceled.
Without run loops this does nothing and returns.
Sourcepub fn run_with_main_window<TWindow: ObjectType + Upcast<Window>>(
&self,
new_window: impl FnOnce() -> Ref<TWindow>,
)
pub fn run_with_main_window<TWindow: ObjectType + Upcast<Window>>( &self, new_window: impl FnOnce() -> Ref<TWindow>, )
Creates a window with new_window, shows it and runs the
application’s main loop until it is closed; see
run_window.
Methods from Deref<Target = FerroObject>§
Sourcepub fn dispatcher(&self) -> &Arc<Dispatcher> ⓘ
pub fn dispatcher(&self) -> &Arc<Dispatcher> ⓘ
Returns the Dispatcher that this object is associated with: the
dispatcher of the thread that owns the object.
Sourcepub fn check_access(&self) -> bool
pub fn check_access(&self) -> bool
Returns whether the calling thread is the thread that owns this object.
Sourcepub fn verify_access(&self)
pub fn verify_access(&self)
Sourcepub fn to_ref(&self) -> Ref<FerroObject>
pub fn to_ref(&self) -> Ref<FerroObject>
A strong reference to this object.
Sourcepub fn to_weak(&self) -> WeakRef<FerroObject>
pub fn to_weak(&self) -> WeakRef<FerroObject>
A weak reference to this object.
Sourcepub fn is<T>(&self) -> boolwhere
T: ObjectType,
pub fn is<T>(&self) -> boolwhere
T: ObjectType,
Whether the object is of class T or a class derived from it.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Returns the object viewed as class T if it is one.
Sourcepub fn on_property_changed(&self, change: &FerroPropertyChangedEventArgs<'_>)
pub fn on_property_changed(&self, change: &FerroPropertyChangedEventArgs<'_>)
Invokes the on_property_changed virtual member.
Sourcepub fn inheritance_parent(&self) -> Option<Ref<FerroObject>>
pub fn inheritance_parent(&self) -> Option<Ref<FerroObject>>
The parent object that inherited property values are inherited from.
Sourcepub fn set_inheritance_parent(&self, value: impl Into<Nullable<FerroObject>>)
pub fn set_inheritance_parent(&self, value: impl Into<Nullable<FerroObject>>)
Sets the parent object that inherited property values are inherited from.
Sourcepub fn clear_value<T>(&self, property: &'static StyledProperty<T>)where
T: PropertyValue,
pub fn clear_value<T>(&self, property: &'static StyledProperty<T>)where
T: PropertyValue,
Clears a property’s local value.
Sourcepub fn get_value<T>(&self, property: &'static StyledProperty<T>) -> Twhere
T: PropertyValue,
pub fn get_value<T>(&self, property: &'static StyledProperty<T>) -> Twhere
T: PropertyValue,
Gets a property value.
Sourcepub fn get_base_value<T>(
&self,
property: &'static StyledProperty<T>,
) -> Option<T>where
T: PropertyValue,
pub fn get_base_value<T>(
&self,
property: &'static StyledProperty<T>,
) -> Option<T>where
T: PropertyValue,
Gets a property’s base value: the value excluding animated values.
Returns None if the value comes from inheritance or the default.
Sourcepub fn is_animating(&self, property: &FerroProperty) -> bool
pub fn is_animating(&self, property: &FerroProperty) -> bool
Checks whether a property is animating.
Sourcepub fn is_set(&self, property: &FerroProperty) -> bool
pub fn is_set(&self, property: &FerroProperty) -> bool
Checks whether a styled property has a value assigned to it or a binding targeting it.
Sourcepub fn set_value<T>(&self, property: &'static StyledProperty<T>, value: T)where
T: PropertyValue,
pub fn set_value<T>(&self, property: &'static StyledProperty<T>, value: T)where
T: PropertyValue,
Sets a property value with local value priority.
Sourcepub fn set_value_with_priority<T>(
&self,
property: &'static StyledProperty<T>,
value: T,
priority: BindingPriority,
) -> Option<Rc<dyn IDisposable>>where
T: PropertyValue,
pub fn set_value_with_priority<T>(
&self,
property: &'static StyledProperty<T>,
value: T,
priority: BindingPriority,
) -> Option<Rc<dyn IDisposable>>where
T: PropertyValue,
Sets a property value with the given priority. For priorities other than local value, disposing the returned handle removes the value.
Sourcepub fn set_current_value<T>(
&self,
property: &'static StyledProperty<T>,
value: T,
)where
T: PropertyValue,
pub fn set_current_value<T>(
&self,
property: &'static StyledProperty<T>,
value: T,
)where
T: PropertyValue,
Sets the value of a property without changing its value source.
This is used by a component that programmatically sets the value of one of its own properties without disabling an application’s declared use of the property: the effective value changes, but existing bindings and styles continue to work. The new value has the property’s current priority.
Sourcepub fn bind_binding(
&self,
property: &'static FerroProperty,
binding: &dyn BindingBase,
) -> Rc<dyn BindingExpressionBase>
pub fn bind_binding( &self, property: &'static FerroProperty, binding: &dyn BindingBase, ) -> Rc<dyn BindingExpressionBase>
Binds a property to a binding. Returns the binding expression which represents the binding instance on this object.
Sourcepub fn bind_binding_with_anchor(
&self,
property: &'static FerroProperty,
binding: &dyn BindingBase,
anchor: Option<&Ref<FerroObject>>,
) -> Rc<dyn BindingExpressionBase>
pub fn bind_binding_with_anchor( &self, property: &'static FerroProperty, binding: &dyn BindingBase, anchor: Option<&Ref<FerroObject>>, ) -> Rc<dyn BindingExpressionBase>
Binds a property to a binding.
Some bindings need context to locate their source: a data context,
named elements or resources. If this object is not an element, or is
not yet attached to the tree, anchor provides that context.
Sourcepub fn indexer(&self, binding: &IndexerDescriptor) -> IndexerBinding
pub fn indexer(&self, binding: &IndexerDescriptor) -> IndexerBinding
Gets a binding to a property of this object: the indexer taking an
IndexerDescriptor
(source[!Property] is source.indexer(&Property.bind())).
Sourcepub fn bind_indexer(
&self,
binding: &IndexerDescriptor,
value: &dyn BindingBase,
) -> Rc<dyn BindingExpressionBase>
pub fn bind_indexer( &self, binding: &IndexerDescriptor, value: &dyn BindingBase, ) -> Rc<dyn BindingExpressionBase>
Binds the property of an
IndexerDescriptor to a binding:
the setter of the indexer (target[!Property] = binding is
target.bind_indexer(&Property.bind(), &binding)).
Sourcepub fn bind<T>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<T>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
pub fn bind<T>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<T>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
Binds a property to an observable.
Sourcepub fn bind_value<T>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<BindingValue<T>>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
pub fn bind_value<T>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<BindingValue<T>>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
Binds a property to an observable of binding values.
Sourcepub fn bind_untyped<T>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<Rc<dyn AnyValue>>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
pub fn bind_untyped<T>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<Rc<dyn AnyValue>>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
Binds a property to an observable of untyped values.
Sourcepub fn coerce_value(&self, property: &'static FerroProperty)
pub fn coerce_value(&self, property: &'static FerroProperty)
Coerces the specified property.
Sourcepub fn get_direct_value<T>(&self, property: &'static DirectPropertyBase<T>) -> Twhere
T: PropertyValue,
pub fn get_direct_value<T>(&self, property: &'static DirectPropertyBase<T>) -> Twhere
T: PropertyValue,
Gets a direct property value.
Sourcepub fn set_direct_value<T>(
&self,
property: &'static DirectPropertyBase<T>,
value: T,
)where
T: PropertyValue,
pub fn set_direct_value<T>(
&self,
property: &'static DirectPropertyBase<T>,
value: T,
)where
T: PropertyValue,
Sets a direct property value.
Sourcepub fn clear_direct_value<T>(&self, property: &'static DirectPropertyBase<T>)where
T: PropertyValue,
pub fn clear_direct_value<T>(&self, property: &'static DirectPropertyBase<T>)where
T: PropertyValue,
Resets a direct property to its unset value.
Sourcepub fn bind_direct<T>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<T>>,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
pub fn bind_direct<T>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<T>>,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
Binds a direct property to an observable.
Sourcepub fn bind_direct_value<T>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<BindingValue<T>>>,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
pub fn bind_direct_value<T>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<BindingValue<T>>>,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
Binds a direct property to an observable of binding values.
Sourcepub fn bind_direct_untyped<T>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<Rc<dyn AnyValue>>>,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
pub fn bind_direct_untyped<T>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<Rc<dyn AnyValue>>>,
) -> Rc<dyn IDisposable>where
T: PropertyValue,
Binds a direct property to an observable of untyped values.
Sourcepub fn set_and_raise<T>(
&self,
property: &'static DirectPropertyBase<T>,
field: &RefCell<T>,
value: T,
) -> boolwhere
T: PropertyValue,
pub fn set_and_raise<T>(
&self,
property: &'static DirectPropertyBase<T>,
field: &RefCell<T>,
value: T,
) -> boolwhere
T: PropertyValue,
Sets the backing field of a direct property, raising a change notification if the value changed. Returns true if it changed.
Sourcepub fn set_and_raise_cell<T>(
&self,
property: &'static DirectPropertyBase<T>,
field: &Cell<T>,
value: T,
) -> boolwhere
T: PropertyValue + Copy,
pub fn set_and_raise_cell<T>(
&self,
property: &'static DirectPropertyBase<T>,
field: &Cell<T>,
value: T,
) -> boolwhere
T: PropertyValue + Copy,
set_and_raise for Copy values stored in a
Cell.
Sourcepub fn get_value_untyped(
&self,
property: &'static FerroProperty,
) -> Rc<dyn AnyValue>
pub fn get_value_untyped( &self, property: &'static FerroProperty, ) -> Rc<dyn AnyValue>
Gets a property value as an untyped value.
Sourcepub fn set_value_untyped(
&self,
property: &'static FerroProperty,
value: &(dyn Any + 'static),
priority: BindingPriority,
) -> Option<Rc<dyn IDisposable>>
pub fn set_value_untyped( &self, property: &'static FerroProperty, value: &(dyn Any + 'static), priority: BindingPriority, ) -> Option<Rc<dyn IDisposable>>
Sets a property from an untyped value, which must hold exactly the property’s value type or the unset marker.
Sourcepub fn set_current_value_untyped(
&self,
property: &'static FerroProperty,
value: &(dyn Any + 'static),
)
pub fn set_current_value_untyped( &self, property: &'static FerroProperty, value: &(dyn Any + 'static), )
set_current_value with an untyped value.
Sourcepub fn clear_value_untyped(&self, property: &'static FerroProperty)
pub fn clear_value_untyped(&self, property: &'static FerroProperty)
Clears a property’s local value.
Sourcepub fn bind_property_untyped(
&self,
property: &'static FerroProperty,
source: Rc<dyn IObservable<Rc<dyn AnyValue>>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>
pub fn bind_property_untyped( &self, property: &'static FerroProperty, source: Rc<dyn IObservable<Rc<dyn AnyValue>>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
Binds a property to an observable of untyped values.
Sourcepub fn property_changed(
&self,
handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) + 'static,
) -> Rc<dyn IDisposable>
pub fn property_changed( &self, handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) + 'static, ) -> Rc<dyn IDisposable>
Subscribes to property changes on this object. Disposing the returned handle unsubscribes.
Sourcepub fn add_property_changed_handler(
&self,
handler: Rc<dyn Fn(&FerroPropertyChangedEventArgs<'_>)>,
) -> u64
pub fn add_property_changed_handler( &self, handler: Rc<dyn Fn(&FerroPropertyChangedEventArgs<'_>)>, ) -> u64
Subscribes handler to property changes on this object and returns
the token that remove_property_changed_handler
takes: property_changed for a subscriber
that keeps the object and the token itself, so that no handle is made.
Sourcepub fn remove_property_changed_handler(&self, token: u64) -> bool
pub fn remove_property_changed_handler(&self, token: u64) -> bool
Ends a subscription of add_property_changed_handler.
Sourcepub fn property_changed_subscriber_count(&self) -> usize
pub fn property_changed_subscriber_count(&self) -> usize
The number of subscribers to property changes on this object (a diagnostics member, used by tests to verify that subscriptions are released).
Sourcepub fn raise_property_changed<T>(
&self,
property: &'static FerroProperty,
old_value: Option<&T>,
new_value: &T,
priority: BindingPriority,
is_effective_value: bool,
)where
T: PropertyValue,
pub fn raise_property_changed<T>(
&self,
property: &'static FerroProperty,
old_value: Option<&T>,
new_value: &T,
priority: BindingPriority,
is_effective_value: bool,
)where
T: PropertyValue,
Raises a property changed notification.
Sourcepub fn raise_direct_property_changed<T>(
&self,
property: &'static DirectPropertyBase<T>,
old_value: &T,
new_value: &T,
)where
T: PropertyValue,
pub fn raise_direct_property_changed<T>(
&self,
property: &'static DirectPropertyBase<T>,
old_value: &T,
new_value: &T,
)where
T: PropertyValue,
Raises a property changed notification for a direct property.
Trait Implementations§
Source§impl ApplicationImpl for Application
impl ApplicationImpl for Application
Source§fn initialize(_this: &Self)
fn initialize(_this: &Self)
Source§fn register_services(this: &Self)
fn register_services(this: &Self)
Source§fn on_framework_initialization_completed(_this: &Self)
fn on_framework_initialization_completed(_this: &Self)
Source§impl Deref for Application
impl Deref for Application
Source§type Target = FerroObject
type Target = FerroObject
Source§fn deref(&self) -> &FerroObject
fn deref(&self) -> &FerroObject
Source§impl FerroObjectImpl for Application
impl FerroObjectImpl for Application
Source§fn constructed(this: &Self)
fn constructed(this: &Self)
parent_constructed first.Source§fn on_property_changed(this: &Self, change: &FerroPropertyChangedEventArgs<'_>)
fn on_property_changed(this: &Self, change: &FerroPropertyChangedEventArgs<'_>)
Source§fn on_property_changed_core(
this: &Self,
change: &FerroPropertyChangedEventArgs<'_>,
)
fn on_property_changed_core( this: &Self, change: &FerroPropertyChangedEventArgs<'_>, )
on_property_changed instead.Source§fn update_data_validation(
this: &Self,
property: &'static FerroProperty,
state: BindingValueType,
error: Option<&BindingError>,
)
fn update_data_validation( this: &Self, property: &'static FerroProperty, state: BindingValueType, error: Option<&BindingError>, )
Source§impl NewApplication for Application
impl NewApplication for Application
Source§fn new_application() -> Ref<Self>
fn new_application() -> Ref<Self>
Source§impl ObjectType for Application
impl ObjectType for Application
Source§type Parent = FerroObject
type Parent = FerroObject
Source§type VTable = ApplicationVTable
type VTable = ApplicationVTable
Source§fn vtable() -> &'static Self::VTable
fn vtable() -> &'static Self::VTable
Self.Source§fn register_class()
fn register_class()
Source§impl StaticType for Application
impl StaticType for Application
impl<T: ApplicationImpl> Subclassable<T> for Applicationwhere
FerroObject: Subclassable<T>,
Source§impl Upcast<Application> for Application
impl Upcast<Application> for Application
fn upcast(&self) -> &Application
Auto Trait Implementations§
impl !Freeze for Application
impl !RefUnwindSafe for Application
impl !Send for Application
impl !Sync for Application
impl !UnwindSafe for Application
impl Unpin for Application
impl UnsafeUnpin for Application
Blanket Implementations§
Source§impl<T> ApplicationImplExt for Twhere
T: ApplicationImpl,
impl<T> ApplicationImplExt for Twhere
T: ApplicationImpl,
Source§fn parent_initialize(this: &Self)
fn parent_initialize(this: &Self)
Source§fn parent_register_services(this: &Self)
fn parent_register_services(this: &Self)
Source§fn parent_on_framework_initialization_completed(this: &Self)
fn parent_on_framework_initialization_completed(this: &Self)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more