Class ComponentViewLocationExpander
- Namespace
- Htmx.Components.Configuration
- Assembly
- Htmx.Components.dll
Expands view locations to look for ViewComponent views within their respective component folders. This enables a self-contained folder structure where each ViewComponent can have its views co-located with its C# code.
public class ComponentViewLocationExpander : IViewLocationExpander
- Inheritance
-
ComponentViewLocationExpander
- Implements
- Inherited Members
- Extension Methods
Methods
ExpandViewLocations(ViewLocationExpanderContext, IEnumerable<string>)
Expands the list of view locations to include component-specific folders. This enables views to be co-located with their ViewComponent classes in organized folder structures.
public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable<string> viewLocations)
Parameters
context
ViewLocationExpanderContextThe context containing information about the current view location expansion
viewLocations
IEnumerable<string>The existing collection of view locations to search
Returns
- IEnumerable<string>
An expanded collection of view locations that includes component-specific paths
PopulateValues(ViewLocationExpanderContext)
Populates the context values used by this view location expander. This method is called during view resolution to identify this expander's contribution.
public void PopulateValues(ViewLocationExpanderContext context)
Parameters
context
ViewLocationExpanderContextThe context containing information about the current view location expansion