Feature summary
Dear James,
I was trying out your package and I have a question about the ViewComponent part of this package.
I have this simple class:
public class SavedForm {
public string? Subject { get; set; }
public string? ContentBody { get; set; }
}
And I have a simple dashboard:
public class SavedFormsDashboard : SimpleDashboard { }
And I have a ViewComponent that returns a list of (random) SavedForm objects to a view:
public class SavedFormsDashboardViewComponent : DashboardViewComponent {
public override IViewComponentResult Invoke(DashboardViewModel model) {
var viewModel = SavedFormGenerator.GenerateRandomForms();
return View("~/Views/Dashboards/SavedForms.cshtml", viewModel);
}
}
The view is:
@inherits Umbraco.Community.SimpleDashboards.Web.DashboardViewPage
@*model List<SavedForm>*@
<uui-box headline="Hello Umbraco">
My Dashboard is: @Model.Dashboard.Alias
</uui-box>
How do I get this to work? How do access the list of SavedForm objects in the view?
I want to show a list of the 'SavedForm' objects with this component.
Kind regards,
Dave
Additional details
No response
Feature summary
Dear James,
I was trying out your package and I have a question about the ViewComponent part of this package.
I have this simple class:
And I have a simple dashboard:
public class SavedFormsDashboard : SimpleDashboard { }And I have a ViewComponent that returns a list of (random) SavedForm objects to a view:
The view is:
How do I get this to work? How do access the list of SavedForm objects in the view?
I want to show a list of the 'SavedForm' objects with this component.
Kind regards,
Dave
Additional details
No response