-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #731 from havit/feature/HxListLayout-NamedViewsOve…
…rhaul HxListLayout - Named Views overhaul (HxNamedViewList component removed)
- Loading branch information
Showing
11 changed files
with
232 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
Havit.Blazor.Components.Web.Bootstrap/NamedViews/HxNamedViewList.razor
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
Havit.Blazor.Components.Web.Bootstrap/NamedViews/HxNamedViewList.razor.cs
This file was deleted.
Oops, something went wrong.
30 changes: 17 additions & 13 deletions
30
Havit.Blazor.Components.Web.Bootstrap/NamedViews/NamedView.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
namespace Havit.Blazor.Components.Web.Bootstrap; | ||
|
||
/// <summary> | ||
/// Represents a named view for <see cref="HxListLayout{TFilterModel}" />. | ||
/// </summary> | ||
public class NamedView<TFilterModel> | ||
{ | ||
/// <summary> | ||
/// Name of the view. Used as a label in the list. Can be used as a title for the <see cref="HxListLayout{TFilterModel}" />. | ||
/// </summary> | ||
public string Name { get; } | ||
|
||
public Func<TFilterModel> Filter { get; } | ||
/// <summary> | ||
/// Creates new filter model for the view. | ||
/// </summary> | ||
public Func<TFilterModel> FilterModelFactory { get; } | ||
|
||
public NamedView(string name) : this(name, () => default) | ||
{ | ||
// NOOP | ||
} | ||
|
||
public NamedView(string name, TFilterModel filter) : this(name, () => filter) | ||
{ | ||
// NOOP | ||
} | ||
|
||
public NamedView(string name, Func<TFilterModel> filterFunc) | ||
/// <summary> | ||
/// Creates a new instance of <see cref="NamedView{TFilterModel}" /> which uses a factory to build a filter model. | ||
/// </summary> | ||
/// <param name="name">Name of the view.</param> | ||
/// <param name="filterModelFactory">Function which builds a new filter model to be applied when the view is selected.</param> | ||
public NamedView(string name, Func<TFilterModel> filterModelFactory) | ||
{ | ||
Name = name; | ||
Filter = filterFunc; | ||
FilterModelFactory = filterModelFactory; | ||
} | ||
} |
Oops, something went wrong.