pub struct ResourceSetterViewModel { /* private fields */ }Expand description
A setter whose value is a resource: the key of the resource and the value it has for the control, with a tint and a tooltip that tell a dynamic resource from a static one.
Implementations§
Source§impl ResourceSetterViewModel
impl ResourceSetterViewModel
pub fn new( property: &'static FerroProperty, resource_key: BoxedValue, resource_value: Option<BoxedValue>, is_dynamic: bool, clipboard: Option<Rc<dyn IClipboard>>, ) -> Rc<Self>
pub fn key(&self) -> BoxedValue
pub fn tint(&self) -> Rc<dyn IBrush>
pub fn value_type_tooltip(&self) -> String
Sourcepub fn copy_value(&self)
pub fn copy_value(&self)
The CopyValue of the base class (this class does not override it).
pub fn copy_resource_key(&self)
Methods from Deref<Target = SetterViewModel>§
pub fn property(&self) -> &'static FerroProperty
pub fn name(&self) -> String
pub fn value(&self) -> Option<BoxedValue>
pub fn is_active(&self) -> bool
pub fn set_is_active(&self, value: bool)
pub fn is_visible(&self) -> bool
pub fn set_is_visible(&self, value: bool)
Sourcepub fn copy_value(&self)
pub fn copy_value(&self)
CopyValue of this class (the virtual member dispatches through SetterViewModelRef):
copies the text of the value.
pub fn copy_property_name(&self)
Sourcepub fn copy_to_clipboard(&self, value: &str)
pub fn copy_to_clipboard(&self, value: &str)
CopyToClipboard: starts setting the text of the clipboard, without waiting for it (the
managed original discards the task).
Trait Implementations§
Source§impl Deref for ResourceSetterViewModel
impl Deref for ResourceSetterViewModel
Source§type Target = SetterViewModel
type Target = SetterViewModel
The resulting type after dereferencing.
Source§fn deref(&self) -> &SetterViewModel
fn deref(&self) -> &SetterViewModel
Dereferences the value.
Source§impl INotifyPropertyChanged for ResourceSetterViewModel
impl INotifyPropertyChanged for ResourceSetterViewModel
Source§fn property_changed(&self) -> &Event<str>
fn property_changed(&self) -> &Event<str>
The event raised when a property value changes.
Source§fn as_notify_property_changing(&self) -> Option<&dyn INotifyPropertyChanging>
fn as_notify_property_changing(&self) -> Option<&dyn INotifyPropertyChanging>
The object as
INotifyPropertyChanging, when it also raises the event of a property
that is about to change; None by default. Read moreSource§impl MarkupTyped for ResourceSetterViewModel
impl MarkupTyped for ResourceSetterViewModel
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
The markup metadata of the type.
Auto Trait Implementations§
impl !Freeze for ResourceSetterViewModel
impl !RefUnwindSafe for ResourceSetterViewModel
impl !Send for ResourceSetterViewModel
impl !Sync for ResourceSetterViewModel
impl !UnwindSafe for ResourceSetterViewModel
impl Unpin for ResourceSetterViewModel
impl UnsafeUnpin for ResourceSetterViewModel
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
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