Skip to content

Commit eaa7214

Browse files
committed
chore(CodeSampleService): Use new Generic Service in Models
1 parent 97e3e4c commit eaa7214

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/CounterModel.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ namespace DevTKSS.Uno.Samples.MvuxGallery.Presentation.ViewModels;
22

33
public partial record CounterModel
44
{
5+
private readonly ICodeSampleService<CounterSampleOptions> _sampleService;
56
private readonly IStringLocalizer _stringLocalizer;
6-
public CounterModel(IStringLocalizer stringLocalizer)
7+
private readonly ILogger _logger;
8+
public CounterModel(
9+
IStringLocalizer stringLocalizer,
10+
ICodeSampleService<CounterSampleOptions> sampleService,
11+
ILogger<CounterModel> logger)
712
{
8-
this._stringLocalizer = stringLocalizer;
13+
_logger = logger;
14+
_sampleService = sampleService;
15+
_stringLocalizer = stringLocalizer;
916
}
1017

1118
public IState<string> CounterTitle => State<string>.Value(this, () => _stringLocalizer["CounterTitle"]);

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/ListboardModel.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Runtime.CompilerServices;
2-
31
namespace DevTKSS.Uno.Samples.MvuxGallery.Presentation.ViewModels;
42

53
/// <summary>
@@ -18,7 +16,7 @@ public partial record ListboardModel
1816
/// <summary>
1917
/// Service for managing code samples.
2018
/// </summary>
21-
private readonly ICodeSampleService<ListboardCodeSampleOptions> _codeSampleService;
19+
private readonly ICodeSampleService<ListboardSampleOptions> _codeSampleService;
2220

2321
/// <summary>
2422
/// Service for retrieving gallery images.
@@ -37,7 +35,7 @@ public ListboardModel(
3735
IGalleryImageService galleryImageService,
3836
IServiceProvider serviceProvider,
3937
ILogger<ListboardModel> logger,
40-
ICodeSampleService<ListboardCodeSampleOptions> sampleService)
38+
ICodeSampleService<ListboardSampleOptions> sampleService)
4139
{
4240
_logger = logger;
4341
this._stringLocalizer = stringLocalizer;

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/SimpleCardsModel.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
namespace DevTKSS.Uno.Samples.MvuxGallery.Presentation.ViewModels;
22
public partial record SimpleCardsModel
33
{
4-
private readonly IStorage _storage;
5-
public SimpleCardsModel(IStorage storage)
4+
private readonly ICodeSampleService<SimpleCardsSampleOptions> _sampleService;
5+
private readonly ILogger _logger;
6+
public SimpleCardsModel(
7+
ICodeSampleService<SimpleCardsSampleOptions> sampleService,
8+
ILogger<SimpleCardsModel> logger
9+
)
610
{
7-
_storage = storage;
11+
_logger = logger;
12+
_sampleService = sampleService;
813
}
914

1015

0 commit comments

Comments
 (0)