# PersonPicture

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/struct-personpicture/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
struct PersonPicture
```

A picture of a person or a group (WinUI's `PersonPicture`): the profile picture, else the
initials of the display name or of the contact, else the glyph of a contact, in a circle,
with a badge (a number, a glyph or an image) at its top right.

The template is the control theme of the WinUI theme (`Controls/PersonPicture.xaml`, from
WinUI's `PersonPicture.xaml`), with WinUI's parts `InitialsTextBlock`, `BadgeNumberTextBlock`,
`BadgeGlyphIcon`, `BadgingEllipse` and `BadgingBackgroundEllipse`. The control sets WinUI's
visual states as pseudo-classes: `:photo`, `:nophotoorinitials` and `:group` (CommonStates;
Initials sets none), `:badge` and `:badgeimage` (BadgeStates). It keeps itself a circle: a
change of its size sets its width and height to the smaller of them, as WinUI's does. The
Fluent and Simple themes have no template for it (docs/porting/winui-controls.md, section 5.1).

Differences (docs/porting/winui-controls.md, section 10.10): the contact is FerroUI's
[`Contact`](/docs/0.5.0/api/ferroui-controls/struct-contact/), whose pictures are images, so the picture of a contact is shown at once (WinUI
opens and decodes a stream reference asynchronously, at the size of the control); the
pictures are image brush sources (a bitmap), the type of the image brush that paints them.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L52)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`badge_number_property`](#function-badge_number_property)
- [`badge_glyph_property`](#function-badge_glyph_property)
- [`badge_image_source_property`](#function-badge_image_source_property)
- [`badge_text_property`](#function-badge_text_property)
- [`is_group_property`](#function-is_group_property)
- [`contact_property`](#function-contact_property)
- [`display_name_property`](#function-display_name_property)
- [`initials_property`](#function-initials_property)
- [`prefer_small_image_property`](#function-prefer_small_image_property)
- [`profile_picture_property`](#function-profile_picture_property)
- [`template_settings_property`](#function-template_settings_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`badge_number`](#function-badge_number)
- [`set_badge_number`](#function-set_badge_number)
- [`badge_glyph`](#function-badge_glyph)
- [`set_badge_glyph`](#function-set_badge_glyph)
- [`badge_image_source`](#function-badge_image_source)
- [`set_badge_image_source`](#function-set_badge_image_source)
- [`badge_text`](#function-badge_text)
- [`set_badge_text`](#function-set_badge_text)
- [`is_group`](#function-is_group)
- [`set_is_group`](#function-set_is_group)
- [`contact`](#function-contact)
- [`set_contact`](#function-set_contact)
- [`display_name`](#function-display_name)
- [`set_display_name`](#function-set_display_name)
- [`initials`](#function-initials)
- [`set_initials`](#function-set_initials)
- [`prefer_small_image`](#function-prefer_small_image)
- [`set_prefer_small_image`](#function-set_prefer_small_image)
- [`profile_picture`](#function-profile_picture)
- [`set_profile_picture`](#function-set_profile_picture)
- [`template_settings`](#function-template_settings)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L61)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<PersonPicture>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L61)

<a id="function-badge_number_property"></a>

### badge_number_property

```rust
fn badge_number_property() -> &'static StyledProperty<i32>
```

Defines the `BadgeNumber` property: the number of the badge, none at 0 (the default);
more than 99 shows "99+".

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-badge_glyph_property"></a>

### badge_glyph_property

```rust
fn badge_glyph_property() -> &'static StyledProperty<String>
```

Defines the `BadgeGlyph` property: a glyph of the symbol font for the badge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-badge_image_source_property"></a>

### badge_image_source_property

```rust
fn badge_image_source_property() -> &'static StyledProperty<Option<Rc<dyn IImageBrushSource>>>
```

Defines the `BadgeImageSource` property: an image for the badge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-badge_text_property"></a>

### badge_text_property

```rust
fn badge_text_property() -> &'static StyledProperty<String>
```

Defines the `BadgeText` property: what the badge stands for in the automation name
("5 messages" instead of "5 items").

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-is_group_property"></a>

### is_group_property

```rust
fn is_group_property() -> &'static StyledProperty<bool>
```

Defines the `IsGroup` property: whether the picture stands for a group.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-contact_property"></a>

### contact_property

```rust
fn contact_property() -> &'static StyledProperty<Option<Ref<Contact>>>
```

Defines the `Contact` property: the contact whose picture and initials are shown.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-display_name_property"></a>

### display_name_property

```rust
fn display_name_property() -> &'static StyledProperty<String>
```

Defines the `DisplayName` property: the name the initials are made from.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-initials_property"></a>

### initials_property

```rust
fn initials_property() -> &'static StyledProperty<String>
```

Defines the `Initials` property: the initials, before those of the display name.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-prefer_small_image_property"></a>

### prefer_small_image_property

```rust
fn prefer_small_image_property() -> &'static StyledProperty<bool>
```

Defines the `PreferSmallImage` property: whether the small picture of the contact is
shown before the large one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-profile_picture_property"></a>

### profile_picture_property

```rust
fn profile_picture_property() -> &'static StyledProperty<Option<Rc<dyn IImageBrushSource>>>
```

Defines the `ProfilePicture` property: the picture, before the one of the contact.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-template_settings_property"></a>

### template_settings_property

```rust
fn template_settings_property() -> &'static StyledProperty<Option<Ref<PersonPictureTemplateSettings>>>
```

Defines the `TemplateSettings` property: the initials and the brush the template binds to.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L199)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L289)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```

Creates a picture without a person.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L303)

<a id="function-badge_number"></a>

### badge_number

```rust
fn badge_number(self: &Self) -> i32
```

Gets the number of the badge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L310)

<a id="function-set_badge_number"></a>

### set_badge_number

```rust
fn set_badge_number(self: &Self, value: i32)
```

Sets the number of the badge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L315)

<a id="function-badge_glyph"></a>

### badge_glyph

```rust
fn badge_glyph(self: &Self) -> String
```

Gets the glyph of the badge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L320)

<a id="function-set_badge_glyph"></a>

### set_badge_glyph

```rust
fn set_badge_glyph(self: &Self, value: impl Into<String>)
```

Sets the glyph of the badge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L325)

<a id="function-badge_image_source"></a>

### badge_image_source

```rust
fn badge_image_source(self: &Self) -> Option<Rc<dyn IImageBrushSource>>
```

Gets the image of the badge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L330)

<a id="function-set_badge_image_source"></a>

### set_badge_image_source

```rust
fn set_badge_image_source(self: &Self, value: Option<Rc<dyn IImageBrushSource>>)
```

Sets the image of the badge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L335)

<a id="function-badge_text"></a>

### badge_text

```rust
fn badge_text(self: &Self) -> String
```

Gets what the badge stands for in the automation name.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L340)

<a id="function-set_badge_text"></a>

### set_badge_text

```rust
fn set_badge_text(self: &Self, value: impl Into<String>)
```

Sets what the badge stands for in the automation name.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L345)

<a id="function-is_group"></a>

### is_group

```rust
fn is_group(self: &Self) -> bool
```

Gets whether the picture stands for a group.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L350)

<a id="function-set_is_group"></a>

### set_is_group

```rust
fn set_is_group(self: &Self, value: bool)
```

Sets whether the picture stands for a group.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L355)

<a id="function-contact"></a>

### contact

```rust
fn contact(self: &Self) -> Option<Ref<Contact>>
```

Gets the contact.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L360)

<a id="function-set_contact"></a>

### set_contact

```rust
fn set_contact(self: &Self, value: Option<Ref<Contact>>)
```

Sets the contact.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L365)

<a id="function-display_name"></a>

### display_name

```rust
fn display_name(self: &Self) -> String
```

Gets the display name.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L370)

<a id="function-set_display_name"></a>

### set_display_name

```rust
fn set_display_name(self: &Self, value: impl Into<String>)
```

Sets the display name.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L375)

<a id="function-initials"></a>

### initials

```rust
fn initials(self: &Self) -> String
```

Gets the initials.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L380)

<a id="function-set_initials"></a>

### set_initials

```rust
fn set_initials(self: &Self, value: impl Into<String>)
```

Sets the initials.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L385)

<a id="function-prefer_small_image"></a>

### prefer_small_image

```rust
fn prefer_small_image(self: &Self) -> bool
```

Gets whether the small picture of the contact is shown before the large one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L390)

<a id="function-set_prefer_small_image"></a>

### set_prefer_small_image

```rust
fn set_prefer_small_image(self: &Self, value: bool)
```

Sets whether the small picture of the contact is shown before the large one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L395)

<a id="function-profile_picture"></a>

### profile_picture

```rust
fn profile_picture(self: &Self) -> Option<Rc<dyn IImageBrushSource>>
```

Gets the profile picture.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L400)

<a id="function-set_profile_picture"></a>

### set_profile_picture

```rust
fn set_profile_picture(self: &Self, value: Option<Rc<dyn IImageBrushSource>>)
```

Sets the profile picture.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L405)

<a id="function-template_settings"></a>

### template_settings

```rust
fn template_settings(self: &Self) -> Ref<PersonPictureTemplateSettings>
```

Gets the initials and the brush the template binds to.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/person_picture.rs#L410)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<PersonPicture>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
