Questions tagged [blazor-component]

53 questions
6
votes
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
  • 78
  • 2
  • 5
6
votes
2 answers

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
  • 171
  • 1
  • 7
5
votes
2 answers

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…
4
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
  • 3,229
  • 1
  • 27
  • 41
2
votes
0 answers

Scoped CSS files are not applying their styles in Razor Class Library Components

A component in a Razor Class Library has it's scoped CSS file, but the classes in there are not being applied. Even the CSS class name my-component found in the out-of-the-box component Component1.razor does not apply to its styles defined in the…
2
votes
1 answer

Blazor - Passing a function to dynamic component

I'd like to have a fluent communication between components via DynamicComponent in Blazor. Thus I'd like to know whether its possible to pass a function to a DynamicComponent since now it doesn't know that the would be rendered components need a…
Zigzagas
  • 73
  • 1
  • 7
2
votes
1 answer

Blazor server side SPA: Component state after reloading component

The problem is the following: I have a component which holds a table and some searchfields for the table. If I do a search and after that I go to another page and back to the table page, all values of the table component are resetted. Like the…
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
  • 4
1
vote
1 answer

Razor component value not updating inside LocationChanged event handler

Razor component value is not updating inside LocationChanged event handler. I have created a Razor component Breadcrumb.razor. I'm using this component inside my MainLayout.razor page. I need to update my breadcrumb values on…
habib
  • 2,366
  • 5
  • 25
  • 41
1
vote
0 answers

Blazor best way to broadcast a generic change to other components

I have a series of nested components like this: LocationDetails NodeWithChildren NodeDetails PhotoGallery (shows images of current node) PhotoGalleryZoom (modal dialog) ImageEditor The NodeWithDetails…
iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
1
vote
4 answers

Blazor Component is not re-rendering after data is loaded

I have created a DropDownList box component which is bound to a long list of vendors. ContractVendorSelect.razor
@if (IsLoaded) {