Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
docs: Document InitializeComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
worldbeater authored Feb 28, 2021
1 parent 37a4482 commit fbcc40f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
}
Expand All @@ -67,7 +70,7 @@ public partial class SignUpView : ReactiveWindow<SignUpViewModel>
{
public SignUpView()
{
AvaloniaXamlLoader.Load(this);
InitializeComponent();
this.WhenActivated(disposables =>
{
this.BindValidation(ViewModel, x => x.UserName, x => x.UserNameValidation.Text)
Expand Down

0 comments on commit fbcc40f

Please sign in to comment.