Skip to content

Commit 4e00332

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

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,36 +105,36 @@ public string Name
105105
```
106106
----
107107

108-
### `AsyncRelayComand<T>`
108+
### `AsyncRelayComand<TCommandParam>`
109109
Reusable generic command class that encapsulates `ICommand` and allows asynchronous execution.
110110
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`
114+
Declare async `ICommand`:
115115

116116
```c#
117-
// ICommand property
118-
public IAsyncRelayCommand<string> StringAsyncCommand => new AsyncRelayCommand<string>(ProcessStringAsync);
117+
// ICommand. The command delegate 'Task ProcessStringAsync(string)' returns a 'Task' object and is awaitable.
118+
public IAsyncRelayCommand<string> SomeAsyncCommand => new AsyncRelayCommand<string>(ProcessStringAsync);
119119
```
120120
Execute XAML:
121121

122122
```XAML
123123

124124
<!-- Executes asynchronously, because an awaitable delegate was registered with the IAsyncRelayCommand -->
125-
<Button Command="{Binding StringAsyncCommand}" />
125+
<Button Command="{Binding SomeAsyncCommand}" />
126126

127127
```
128128

129-
Execute C#
129+
Execute C#:
130130

131131
```C#
132132

133133
// Execute asynchronously
134-
await StringAsyncCommand.ExecuteAsync("String value");
134+
await this.SomeAsyncCommand.ExecuteAsync("String value");
135135

136136
// Execute synchronously
137-
StringAsyncCommand.Execute("String value");
137+
this.SomeAsyncCommand.Execute("String value");
138138

139139
```
140140

0 commit comments

Comments
 (0)