Skip to content

Commit 2548cc0

Browse files
authored
housekeeping: Add Images Showing the Capabilities (#149)
1 parent 7ff3279 commit 2548cc0

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

README.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,23 @@ dotnet add package ReactiveUI.Validation.AndroidX
149149

150150
> **Note** In ReactiveUI.Validation **1.7 and lower**, the Android-specific extensions are available in [the main package](https://www.nuget.org/packages/reactiveui.validation) targeting `MonoAndroid90`, and you don't need to install `ReactiveUI.Validation.AndroidSupport`. In ReactiveUI.Validation **1.7 and lower**, add `using ReactiveUI.Validation.Platforms.Android` instead of `using ReactiveUI.Validation.Extensions`.
151151
152+
<img src="https://user-images.githubusercontent.com/6759207/96716730-15729480-13ae-11eb-928e-7e408b7ffac4.png" width="400" />
153+
152154
```csharp
153155
// This using directive makes Android-specific extensions available.
154156
// Make sure to install either the ReactiveUI.Validation.AndroidSupport
155157
// package or the ReactiveUI.Validation.AndroidX package.
156158
using ReactiveUI.Validation.Extensions;
157159

158-
public class SampleActivity : ReactiveAppCompatActivity<SampleViewModel>
160+
public class SignUpActivity : ReactiveAppCompatActivity<SignUpViewModel>
159161
{
160-
public TextInputEditText Name { get; set; }
162+
// The Android native text boxes declared in an .axml file.
163+
public TextInputEditText Password { get; set; }
164+
public TextInputEditText ConfirmPassword { get; set; }
161165

162-
public TextInputLayout NameLayout { get; set; }
166+
// The layouts wrapping the text boxes declared in an .axml file.
167+
public TextInputLayout PasswordField { get; set; }
168+
public TextInputLayout ConfirmPasswordField { get; set; }
163169

164170
protected override void OnCreate (Bundle bundle)
165171
{
@@ -169,11 +175,13 @@ public class SampleActivity : ReactiveAppCompatActivity<SampleViewModel>
169175
// The WireUpControls method is a magic ReactiveUI utility method for Android, see:
170176
// https://www.reactiveui.net/docs/handbook/data-binding/xamarin-android/wire-up-controls
171177
this.WireUpControls();
172-
this.Bind(ViewModel, vm => vm.Name, view => view.Name.Text);
178+
this.Bind(ViewModel, x => x.Password, x => x.Password.Text);
179+
this.Bind(ViewModel, x => x.ConfirmPassword, x => x.ConfirmPassword.Text);
173180

174-
// Bind any validations which reference the Name property
181+
// Bind any validations which reference the Password property
175182
// to the Error property of the TextInputLayout control.
176-
this.BindValidation(ViewModel, vm => vm.Name, NameLayout);
183+
this.BindValidation(ViewModel, x => x.Password, PasswordField);
184+
this.BindValidation(ViewModel, x => x.ConfirmPassword, ConfirmPasswordField);
177185
}
178186
}
179187
```
@@ -182,6 +190,8 @@ public class SampleActivity : ReactiveAppCompatActivity<SampleViewModel>
182190

183191
For those platforms that support the `INotifyDataErrorInfo` interface, ReactiveUI.Validation provides a helper base class named `ReactiveValidationObject`. The helper class implements both the `IValidatableViewModel` interface and the `INotifyDataErrorInfo` interface. It listens to any changes in the `ValidationContext` and invokes `INotifyDataErrorInfo` events.
184192

193+
<img width="400" src="https://user-images.githubusercontent.com/6759207/96717163-bbbe9a00-13ae-11eb-8c54-89cd339cbd5c.png">
194+
185195
```cs
186196
public class SampleViewModel : ReactiveValidationObject
187197
{

0 commit comments

Comments
 (0)