C
C#6d ago
SKJonathan

Maui.Graphics, using a razor file instead of a .xaml.cs file

Im using the maui blazor hybrid, and for the project im doing it would be better to use a razor file for it then .xaml.cs file. I cannot figure out how or if it can be done. it sounds like its supposed to work. I need help figuring out the syntax for it. Thanks anyway. (I know the code doesnt do much) but just if i can somehow do it type it directly into the beam.razor
No description
No description
No description
2 Replies
SKJonathan
SKJonathanOP6d ago
Im creating a Maui, blazor hybrid app. Im wondering if you can somehow do what I do in the mainpage.xaml.cs in the beam.razor instead
lycian
lycian6d ago
No idea what beam graphics is but you can definitely have a Beam.razor.cs or put code in an @code block (I suggest the former). Then you'll just need to use an html canvas instead of a GraphicsView . There's a package https://github.com/BlazorExtensions/Canvas to help make it easier to use in blazor
GitHub
GitHub - BlazorExtensions/Canvas: HTML5 Canvas API implementation f...
HTML5 Canvas API implementation for Microsoft Blazor - BlazorExtensions/Canvas

Did you find this page helpful?