adospace / reactorui-maui

MauiReactor is a MVU UI framework built on top of .NET MAUI
MIT License
600 stars 50 forks source link

MauiReactor 3 based on .NET MAUI 9 #263

Open adospace opened 1 day ago

adospace commented 1 day ago

MauiReactor 3 targeting .NET 9 is here!

Please check it out: 1) for the latest sources clone the https://github.com/adospace/reactorui-maui/tree/beta-3-net9-1 branch 2) if you just want to link the package point to Nuget beta 3 versions https://www.nuget.org/packages/Reactor.Maui

This ticket will track all my progress and allow me to collect your suggestions and feedbacks.

Currently, MauiReactor 3.0.1-beta works pretty fine and contains most of the new features of MAUI .net 9 release, including the new controls TitleBar and HybridWebView.

Also, there is a breaking change required to load the XAML resources in case you use styles from an XAML dictionary: no reflection is involved and XAML resources are precompiled just like the normal MAUI application. This is how you can continue to use the XAML resources in MauiReactor: https://github.com/adospace/reactorui-maui/tree/beta-3-net9-1/samples/MauiReactor.TestApp

More info and documentation coming soon.

adospace commented 1 day ago

New feature in MauiReactor 3, FormattedString() has now full fluent syntax:

Label(
    FormattedString(
        Span("Red bold, ", Colors.Red, FontAttributes.Bold),
        Span("default, ",
            TapGestureRecognizer(async () => await ContainerPage!.DisplayAlert("Tapped", "This is a tapped Span.", "OK"))
            ),
        Span("italic small.", FontAttributes.Italic, 14)
        )
    )

it was:

.FormattedText(()=>
{
    //of course FomattedText here, being static, can be created as a static variable and passed to Label().FormattedText(myStaticFormattedText)
    MauiControls.FormattedString formattedString = new();
    formattedString.Spans.Add(new MauiControls.Span { Text = "Red bold, ", TextColor = Colors.Red, FontAttributes = FontAttributes.Bold });

    MauiControls.Span span = new() { Text = "default, " };
    span.GestureRecognizers.Add(new MauiControls.TapGestureRecognizer { Command = new Command(async () => await ContainerPage!.DisplayAlert("Tapped", "This is a tapped Span.", "OK")) });
    formattedString.Spans.Add(span);
    formattedString.Spans.Add(new MauiControls.Span { Text = "italic small.", FontAttributes = FontAttributes.Italic, FontSize = 14 });

    return formattedString;
})