From 53942a551e3e25b30df995891b7a916f506c2eff Mon Sep 17 00:00:00 2001 From: "Artyom V. Gorchakov" Date: Sat, 31 Oct 2020 11:45:31 +0300 Subject: [PATCH] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f9e58c6a5a..b8e6aa51a0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -> **Warning** This is just a proof of concept, don't use it for production purposes! There are no unit tests in this project yet. Also, this project hasn't been extensively tested with any other app except for the `XamlNameReferenceGenerator.Sandbox` app. +> **Warning** This tool hasn't been extensively tested, so use at your own risk. ### C# `SourceGenerator` for Typed Avalonia `x:Name` References @@ -13,9 +13,10 @@ So in your project file you write the following code: %(Filename) - + Designer - + + @@ -47,7 +48,7 @@ public partial class SignUpView : Window ### What do the generated sources look like? -For the [`SignUpView` view class](https://github.com/worldbeater/XamlNameReferenceGenerator/blob/main/XamlNameReferenceGenerator.Sandbox/SignUpView.xaml#L6) from [the sandbox project](https://github.com/worldbeater/XamlNameReferenceGenerator/tree/main/XamlNameReferenceGenerator.Sandbox), we get the following generated output: +For the [`SignUpView` view class](https://github.com/worldbeater/XamlNameReferenceGenerator/blob/main/src/XamlNameReferenceGenerator.Sandbox/Views/SignUpView.xaml) from [the sandbox project](https://github.com/worldbeater/XamlNameReferenceGenerator/tree/main/XamlNameReferenceGenerator.Sandbox), we get the following generated output: ```cs // @@ -75,7 +76,7 @@ namespace XamlNameReferenceGenerator.Sandbox The typed `x:Name` references might be useful if you decide to use e.g. [ReactiveUI code-behind bindings](https://www.reactiveui.net/docs/handbook/data-binding/): ```cs -[GenerateTypedNameReferences] // Coolstuff! +[GenerateTypedNameReferences] // UserNameValidation and PasswordValidation are auto generated. public partial class SignUpView : ReactiveWindow { public SignUpView() @@ -83,7 +84,6 @@ public partial class SignUpView : ReactiveWindow AvaloniaXamlLoader.Load(this); this.WhenActivated(disposables => { - // Coolstuff! this.BindValidation(ViewModel, x => x.UserName, x => x.UserNameValidation.Text) .DisposeWith(disposables); this.BindValidation(ViewModel, x => x.Password, x => x.PasswordValidation.Text)