# ProgressRing

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

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

```rust
struct ProgressRing
```

A ring that shows that something is in progress (WinUI's `ProgressRing`): a spinning arc while
`is_indeterminate` (the default), the part of a ring of the
`value` between `minimum` and `maximum`
otherwise, and nothing while not `is_active`.

As in WinUI, `Value`, `Minimum` and `Maximum` are properties of the ring (not of `RangeBase`),
coerced as `ProgressRing.cpp` coerces them: the bound set last wins, and a value outside the
range is moved into it. The control sets the states of WinUI as pseudo-classes, which the
control theme of the WinUI theme (`src/FerroUI.Themes.WinUI/Controls/ProgressRing.xaml`)
styles: `:active` (Active), `:determinate-active` (DeterminateActive) and `:inactive`
(Inactive).

WinUI draws the ring with an `AnimatedVisualPlayer` and the Lottie compositions of its animated
visuals, which the code plays. FerroUI has no player: the template draws the ring with `Arc`
shapes, and the control moves the arc of the template part `PART_Indicator` as the code of
WinUI plays the compositions: the indeterminate composition loops over two seconds (the arc
grows to half the ring and shrinks while it turns 900 degrees), and a determinate change plays
the determinate composition from the old to the new value (two seconds for the whole ring), a
decrease at once. The clock is the ring's `Clock`, or the global clock; the motion stops while
the ring is inactive, hidden or out of the visual tree. `DeterminateSource` and
`IndeterminateSource` (preview members of WinUI) are not ported. The Fluent and Simple themes
have no template for it (docs/porting/winui-controls.md, section 5.1).

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`is_active_property`](#function-is_active_property)
- [`is_indeterminate_property`](#function-is_indeterminate_property)
- [`value_property`](#function-value_property)
- [`minimum_property`](#function-minimum_property)
- [`maximum_property`](#function-maximum_property)
- [`template_settings_property`](#function-template_settings_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`is_active`](#function-is_active)
- [`set_is_active`](#function-set_is_active)
- [`is_indeterminate`](#function-is_indeterminate)
- [`set_is_indeterminate`](#function-set_is_indeterminate)
- [`value`](#function-value)
- [`set_range_value`](#function-set_range_value)
- [`minimum`](#function-minimum)
- [`set_minimum`](#function-set_minimum)
- [`maximum`](#function-maximum)
- [`set_maximum`](#function-set_maximum)
- [`template_settings`](#function-template_settings)
- [`normalized_value`](#function-normalized_value)

<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/progress_ring.rs#L85)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### is_active_property

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

Defines the `IsActive` property: whether the ring is shown and moves. `true` by
default.

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

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

### is_indeterminate_property

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

Defines the `IsIndeterminate` property: whether the ring spins (`true`, the default) or
shows its value.

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

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

### value_property

```rust
fn value_property() -> &'static StyledProperty<f64>
```

Defines the `Value` property: the progress between `Minimum` and `Maximum`. 0 by
default.

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

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

### minimum_property

```rust
fn minimum_property() -> &'static StyledProperty<f64>
```

Defines the `Minimum` property. 0 by default.

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

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

### maximum_property

```rust
fn maximum_property() -> &'static StyledProperty<f64>
```

Defines the `Maximum` property. 100 by default.

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

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

### template_settings_property

```rust
fn template_settings_property() -> &'static DirectProperty<ProgressRing, Ref<ProgressRingTemplateSettings>>
```

Defines the `TemplateSettings` property: the values the template binds to (read-only).

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

<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/progress_ring.rs#L232)

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

### new

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

Creates a progress ring.

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

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

### is_active

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

Gets whether the ring is shown and moves.

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

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

### set_is_active

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

Sets whether the ring is shown and moves.

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

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

### is_indeterminate

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

Gets whether the ring spins.

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

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

### set_is_indeterminate

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

Sets whether the ring spins.

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

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

### value

```rust
fn value(self: &Self) -> f64
```

Gets the value.

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

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

### set_range_value

```rust
fn set_range_value(self: &Self, value: f64)
```

Sets the value (`set_range_value`, as `RangeBase` names it: `set_value` is the setter of
properties of the object).

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

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

### minimum

```rust
fn minimum(self: &Self) -> f64
```

Gets the minimum.

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

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

### set_minimum

```rust
fn set_minimum(self: &Self, value: f64)
```

Sets the minimum.

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

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

### maximum

```rust
fn maximum(self: &Self) -> f64
```

Gets the maximum.

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

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

### set_maximum

```rust
fn set_maximum(self: &Self, value: f64)
```

Sets the maximum.

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

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

### template_settings

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

Gets the values the template binds to; each ring has its own.

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

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

### normalized_value

```rust
fn normalized_value(self: &Self) -> f64
```

The progress the determinate ring shows, between 0 and 1: `(value - minimum) / (maximum -
minimum)` (ProgressRing::UpdateLottieProgress). A value that is not a number and an empty
or infinite range show no progress; the properties keep their values.

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

## 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<ProgressRing>`](/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/)
- [`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/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- `Drop`

## Availability

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