Class ActionSheetViewModel
The details and actions of a message or room, opened by a long press or a right click: on phones a sheet from the bottom, on desktops a menu whose details open the sheet.
Inherited Members
Namespace: Uniform.Chat.Avalonia.ViewModels
Assembly: Uniform.Chat.Avalonia.dll
Syntax
public sealed class ActionSheetViewModel : ViewModelBase, INotifyPropertyChanged, INotifyPropertyChanging
Constructors
| Edit this page View SourceActionSheetViewModel(string, IReadOnlyList<SheetDetail>, IReadOnlyList<SheetAction>, IReadOnlyList<string>, Action<string>?, Action)
Create the sheet.
Declaration
public ActionSheetViewModel(string title, IReadOnlyList<SheetDetail> details, IReadOnlyList<SheetAction> actions, IReadOnlyList<string> reactions, Action<string>? react, Action close)
Parameters
| Type | Name | Description |
|---|---|---|
| string | title | What it is about, e.g. the room's name. |
| IReadOnlyList<SheetDetail> | details | Information lines. |
| IReadOnlyList<SheetAction> | actions | Actions, in order. |
| IReadOnlyList<string> | reactions | Quick reactions to offer in a row; empty for none. |
| Action<string> | react | Sends a reaction, or null. |
| Action | close | Closes the sheet. |
Properties
| Edit this page View SourceActions
All top-level actions.
Declaration
public IReadOnlyList<SheetAction> Actions { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<SheetAction> |
BackCommand
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.ActionSheetViewModel.Back().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand BackCommand { get; }
Property Value
| Type | Description |
|---|---|
| IRelayCommand |
ChooseCommand
Gets an IRelayCommand<T> instance wrapping Choose(SheetAction).
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand<SheetAction> ChooseCommand { get; }
Property Value
| Type | Description |
|---|---|
| IRelayCommand<SheetAction> |
Choosing
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("IsChoosing")]
[ExcludeFromCodeCoverage]
public string? Choosing { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
CloseCommand
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.ActionSheetViewModel.Close().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand CloseCommand { get; }
Property Value
| Type | Description |
|---|---|
| IRelayCommand |
Details
Information lines.
Declaration
public IReadOnlyList<SheetDetail> Details { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<SheetDetail> |
HasDetails
Whether there are information lines.
Declaration
public bool HasDetails { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HasReactions
Whether quick reactions are offered.
Declaration
public bool HasReactions { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsChoosing
Whether the choices of an action are shown instead of the top level.
Declaration
public bool IsChoosing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ReactCommand
Gets an IRelayCommand<T> instance wrapping React(string).
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand<string> ReactCommand { get; }
Property Value
| Type | Description |
|---|---|
| IRelayCommand<string> |
Reactions
Quick reactions.
Declaration
public IReadOnlyList<string> Reactions { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Shown
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("IsChoosing")]
[ExcludeFromCodeCoverage]
public IReadOnlyList<SheetAction> Shown { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<SheetAction> |
Title
What the sheet is about.
Declaration
public string Title { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceGoBack()
Go back from choices to the top level; return false when the top level is shown already.
Declaration
public bool GoBack()
Returns
| Type | Description |
|---|---|
| bool |