From fbcc40f9fc89968a2c88ed8cb772566b05ffba87 Mon Sep 17 00:00:00 2001 From: "Artyom V. Gorchakov" Date: Mon, 1 Mar 2021 01:27:03 +0300 Subject: [PATCH] docs: Document InitializeComponent --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index df90e13826..590a900dbb 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,11 @@ namespace Sample.App { public SignUpView() { - AvaloniaXamlLoader.Load(this); - UserNameTextBox.Text = "Joseph"; // Cool stuff! + // This method is generated. Call it before accessing any + // of the generated properties. The 'UserNameTextBox' + // property is also generated. + InitializeComponent(); + UserNameTextBox.Text = "Joseph"; } } } @@ -67,7 +70,7 @@ public partial class SignUpView : ReactiveWindow { public SignUpView() { - AvaloniaXamlLoader.Load(this); + InitializeComponent(); this.WhenActivated(disposables => { this.BindValidation(ViewModel, x => x.UserName, x => x.UserNameValidation.Text)