adospace / reactorui-maui

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

Scaffold SkiaSharp doesnot display #138

Closed cris-m closed 1 year ago

cris-m commented 1 year ago

I was following the document and on Wrap 3rd party controls section I tried the SkiaSharp. Doesnot display anything

[Scaffold(typeof(SkiaSharp.Extended.UI.Controls.SKSurfaceView))]
partial class SKSurfaceView { }

[Scaffold(typeof(SkiaSharp.Extended.UI.Controls.SKAnimatedSurfaceView))]
partial class SKAnimatedSurfaceView { }

[Scaffold(typeof(SkiaSharp.Extended.UI.Controls.SKLottieView))]
partial class SKLottieView { }

class MainPage : Component
{
    public override VisualNode Render()
    {
        return new ContentPage()
        {
            new ScrollView
            {
                new VerticalStackLayout
                {
                    new SKLottieView()
                    .Source(new SkiaSharp.Extended.UI.Controls.SKFileLottieImageSource()
                    {
                        File = "dotnetbot.json"
                    })
                    .IsAnimationEnabled(true)
                    .RepeatCount(-1)
                    .HeightRequest(200)
                    .WidthRequest(200)
                    .HCenter()

                }
                .VCenter()
                .Spacing(25)
                .Padding(30, 0)

            }

        };
    }
}

I am getting a blank view

I am using the same SkiaSharp version.

  <PackageReference Include="Reactor.Maui" Version="1.0.139" />
  <PackageReference Include="Reactor.Maui.Canvas" Version="1.0.139" />
  <PackageReference Include="Reactor.Maui.ScaffoldGenerator" Version="1.0.139" />
  <PackageReference Include="SkiaSharp.Extended.UI.Maui" Version="2.0.0-preview.61" />
cris-m commented 1 year ago

After some time I realized I have to add OutputItemType="Analyzer" and ReferenceOutputAssembly="false" on Reactor.Maui.ScaffoldGenerator package

    <PackageReference Include="Reactor.Maui.ScaffoldGenerator" Version="1.0.139" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>