Components
public class MainComponentState : IState
{
public int Counter { get; set; }
}
public class MainComponent : RxComponent<MainComponentState>
{
public override VisualNode Render()
{
return new RxNavigationPage()
{
new RxContentPage()
{
new RxStackLayout()
{
new RxLabel($"You clicked {State.Counter} times!")
.FontSize(Xamarin.Forms.NamedSize.Large),
new RxButton("Click Here!")
.OnClick(OnButtonClicked)
}
.VCenter()
.HCenter()
}
.Title("Hello World")
};
}
private void OnButtonClicked()
{
SetState(s => s.Counter++);
}
}Last updated