Skip to content

Commit 92ec159

Browse files
authored
Update README.md
1 parent 1e59420 commit 92ec159

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,28 @@ public string Name
107107

108108
### `AsyncRelayComand<T>`
109109
Reusable generic command class that encapsulates `ICommand` and allows asynchronous execution.
110-
When used with a `Binding` the command will execute asynchronously when an awaitable execute handler is assigned to the command.
110+
When used with a `Binding`, the command will always execute asynchronously as long as an awaitable execute handler is assigned to the command.
111111

112112
#### Example
113113

114+
Declare `ICommand`
115+
114116
```c#
115117
// ICommand property
116118
public IAsyncRelayCommand<string> StringAsyncCommand => new AsyncRelayCommand<string>(ProcessStringAsync);
119+
```
120+
Execute XAML:
121+
122+
```XAML
123+
124+
<!-- Executes asynchronously, because an awaitable delegate was registered with the IAsyncRelayCommand -->
125+
<Button Command="{Binding StringAsyncCommand}" />
126+
127+
```
128+
129+
Execute C#
130+
131+
```C#
117132

118133
// Execute asynchronously
119134
await StringAsyncCommand.ExecuteAsync("String value");

0 commit comments

Comments
 (0)