Questions tagged [blazor-component]
13 questions
4
votes
1 answer
When to have more than one root components in Blazor?
In the main method of dotnet core blazor web assembly app there is a WebAssemblyHostBuilder class which builds the host for the blazor application.
In that class there is a public property called RootComponentMappingCollection which one can add the…
Elder1360
- 41
- 5
3
votes
1 answer
CSS isolation in blazor-server components
with the new .NET 5 preview CSS isolation comes in blazor.
Does anybody know, is it possible to use the CSS isolation in blazor server?
I have play a lot around, but in my blazor server app CSS isolation doesn't work.
Or is this feature only…
Daniel Weber
- 71
- 6
2
votes
1 answer
Blazor component not calling OnInitializedAsync on statechange, chained data-fetching
Im new to blazor and still learning, and I have a state-problem with my dashboard.
I have one component that fetches the dashboard and the panels:
@if (Data == null)
{
return;
}
@foreach (var…
svinpals
- 33
- 3
1
vote
2 answers
Blazor: Pass a function that takes parameters to a component and call it from it
I'm trying to split my Blazor Server project into components in order to make it more manageable.
I want my component to have a function passed in as a parameter to it. The function takes a string parameter and it is called with different names from…
ofido
- 28
- 3
1
vote
0 answers
How to send property to method in blazor?
My DataTables component:
@foreach (var paginateButton in paginateButtonList)
{
…
ilyas varol
- 156
- 14
1
vote
0 answers
Inserting abstract Blazor component, open-closed principle
I had no idea how to phrase a good title here.
I'm basically trying to use the open-closed principle, so I don't need to specify precisely which component to render, but just use an interface/abstract class instead.
I'm making a node editor.
I have…
Troels
- 149
- 6
0
votes
1 answer
Blazor templated component to render a form with different context
I have a serie of textboxes to get phone numbers and emails from the user, and I am going to use them in many forms but with different context, for example client, employee, supplier, so I like to know if it is possible to create a templated…
0
votes
1 answer
Blazor Webassembly (.NET 5) customized component with files: validation does not work
I found this great post by Chris Sainty: Creating Bespoke Input Components for Blazor from Scratch. It is exactly what I need, but not with string, but with uploaded files IBrowserFile. So I have adapted and extended the example for me. The…
skyfrog
- 107
- 10
0
votes
1 answer
0
votes
3 answers
Blazor - How to make child component show validation messages?
I need to display validation messages if a nested-component is not properly filled in. The component is consumed by other parent-components and they need to get feedback on whether there are validation issues.
I have tried the following code for the…
jakubiszon
- 1,956
- 1
- 19
- 33
0
votes
0 answers
Blazor component library that also use a component library
I have question about using JS files from sub component libraries. I have a Blazor WASM site and I have created a custom component library for this. In my custom component library I am using the BlazorInputFile library as well. To get this work in…
Andrew
- 51
- 2
0
votes
1 answer
Blazor webassembly, state management. Refresh child components
I am selecting items from the list, and displaying their different content.
It is working correctly with this code:
public class ItemState
{
public Item CurrentItem { get; set; }
public event Action OnItemSelected;
public void…
Roberta
- 15
- 7
0
votes
1 answer
How to target specific div with Blazor components?
I have a top-row div a follows:
App:Title
I am going to have several MenuBar components that…
IAbstract
- 18,848
- 14
- 81
- 137