I want to make a mobile desgin for my already existing blazor-server application I currently have my .razor files and the code behind in .razor.cs files.
What i want to do now is, to use 2 Front ends refering to the same Backend.
For Example
FooDesktop.razor -> Foo.razor.cs
FooMobile.razor -> Foo.razor.cs
Is this possible? If no what are my alternatives.
CodePudding user response:
The solution I came up with goes like:
- Foo.razor.cs goes into a seperate class like FooComponent.cs
- FooMobile.razor and FooDesktop.razor now inherits this base class
- U can you all functionality of the base type inside your razor component