Skip to content

Instantly share code, notes, and snippets.

@jorgesanabria
Created October 29, 2024 22:36
Show Gist options
  • Save jorgesanabria/3acf16dd61715f97a8a4bfbdc43f091f to your computer and use it in GitHub Desktop.
Save jorgesanabria/3acf16dd61715f97a8a4bfbdc43f091f to your computer and use it in GitHub Desktop.
failed test of SwipeView
using MauiReactor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MauiReactor1.Pages
{
internal class MainPageState
{
public int Counter { get; set; }
}
internal class MainPage : Component<MainPageState>
{
public override VisualNode Render()
=> ContentPage(
ScrollView(
VStack(
Image("dotnet_bot.png")
.HeightRequest(200)
.HCenter()
.Set(MauiControls.SemanticProperties.DescriptionProperty, "Cute dot net bot waving hi to you!"),
Label("Hello, World!")
.FontSize(32)
.HCenter(),
SwipeView(
Label("Test swipe")
)
.LeftItems(
SwipeItems(
SwipeItem(
Label("test left item")
)
.BackgroundColor(Colors.Red)
)
)
,
Label("Welcome to MauiReactor: MAUI with superpowers!")
.FontSize(18)
.HCenter(),
Button(State.Counter == 0 ? "Click me" : $"Clicked {State.Counter} times!")
.OnClicked(() => SetState(s => s.Counter++))
.HCenter()
)
.VCenter()
.Spacing(25)
.Padding(30, 0)
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment