Skip to content

Commit 44b8649

Browse files
committed
Reduced scope of INavigationTopicViewModel<T>
The `INavigationTopicViewModel<T>` previously inherited from `ITopicViewModel`. The `ITopicViewModel` has grown since its inception, and also includes a lot of properties that aren't relevant to the `INavigationTopicViewModel<T>`. Given this, I've removed the dependency on `ITopicViewModel` from `INavigationTopicViewModel<T>`, and updated it to include only the most critical properties previously inherited from `ITopicViewModel`—namely `Title` and `WebPath`. Since the `INavigationTopicViewModel<T>` will no longer have a `UniqueKey` property to compare against, I've updated the `IsSelected()` method to accept a `webPath` property instead. This makes more sense in context of how it will be used.
1 parent 219ece4 commit 44b8649

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

OnTopic/Models/INavigationTopicViewModel{T}.cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ namespace OnTopic.Models {
1616
/// No topics are expected to have a <c>Navigation</c> content type. Instead, implementers of this view model are expected
1717
/// to manually construct instances.
1818
/// </remarks>
19-
public interface INavigationTopicViewModel<T> :
20-
ITopicViewModel, IHierarchicalTopicViewModel<T>
21-
where T: INavigationTopicViewModel<T>
22-
{
19+
public interface INavigationTopicViewModel<T> : IHierarchicalTopicViewModel<T> where T: INavigationTopicViewModel<T> {
20+
21+
/*==========================================================================================================================
22+
| PROPERTY: TITLE
23+
\-------------------------------------------------------------------------------------------------------------------------*/
24+
/// <inheritdoc cref="ITopicViewModel.Title"/>
25+
string? Title { get; init; }
2326

2427
/*==========================================================================================================================
2528
| PROPERTY: SHORT TITLE
@@ -31,15 +34,21 @@ public interface INavigationTopicViewModel<T> :
3134
string? ShortTitle { get; init; }
3235

3336
/*==========================================================================================================================
34-
| METHOD: ISSELECTED
37+
| PROPERTY: WEB PATH
38+
\-------------------------------------------------------------------------------------------------------------------------*/
39+
/// <inheritdoc cref="ITopicViewModel.WebPath"/>
40+
string? WebPath { get; init; }
41+
42+
/*==========================================================================================================================
43+
| METHOD: IS SELECTED?
3544
\-------------------------------------------------------------------------------------------------------------------------*/
3645
/// <summary>
37-
/// Determines if the current item is selected based on the provided <paramref name="uniqueKey"/>.
46+
/// Determines if the current item is selected based on the provided <paramref name="webPath"/>.
3847
/// </summary>
39-
/// <param name="uniqueKey">
40-
/// The unique key to compare against the current <see cref="INavigationTopicViewModel{T}"/>
48+
/// <param name="webPath">
49+
/// The path to compare against the current <see cref="INavigationTopicViewModel{T}"/>
4150
/// </param>
42-
bool IsSelected(string uniqueKey);
51+
bool IsSelected(string webPath);
4352

4453
} //Class
4554
} //Namespace

0 commit comments

Comments
 (0)