Maui Preprocessor in Blazor Hybrid #19633
Replies: 3 comments 1 reply
-
You can achieve that using Dependency Injection.
|
Beta Was this translation helpful? Give feedback.
-
In my case, I don't have different implementation for web and hybrid project, most of the implementation were same except I want add some additionally code to razor components when running on hybrid, that's all |
Beta Was this translation helpful? Give feedback.
-
If you need just a flag which tells you that your code is executed in Hybrid you can create static variable in common lib Than you can set Config.IsMaui=true on your MAUI project during initialization |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Blazor Hybrid App, and all the Presentation/Razor Components reside in a Class Library that can be shared between the Blazor Web Assembly app and Blazor Hybrid App. The current issue is that I need to implement specific logic that runs exclusively on the Blazor Hybrid App within that class library. How can I accomplish this? Is there a preprocessor for Maui or any other solution?
For example:
#if Maui
Beta Was this translation helpful? Give feedback.
All reactions