Skip to content

Commit 19286d3

Browse files
committed
Minor fixes to some markdown docs
1 parent bcbe6fc commit 19286d3

File tree

4 files changed

+36
-34
lines changed

4 files changed

+36
-34
lines changed

docs/mvvm/Ioc.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class ConsoleLogger : ILogger
4040
private readonly IFileService FileService;
4141
private readonly IConsoleService ConsoleService;
4242

43-
public FileLogger(
43+
public ConsoleLogger(
4444
IFileService fileService,
4545
IConsoleService consoleService)
4646
{
@@ -63,8 +63,8 @@ Ioc.Default.ConfigureServices(services =>
6363
services.AddSingleton<ILogger, ConsoleLogger>();
6464
});
6565

66-
// Retrieve a console logger with constructor injection
67-
ConsoleLogger consoleLogger = Ioc.Default.GetService<ConsoleLogger>();
66+
// Retrieve a logger service with constructor injection
67+
ILogger consoleLogger = Ioc.Default.GetService<ILogger>();
6868
```
6969

7070
The DI service provider will automatically check whether all the necessary services are registered, then it will retrieve them and invoke the constructor for the registered `ILogger` concrete type, to get the instance to return - all done automatically!

docs/mvvm/PuttingThingsTogether.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -302,23 +302,24 @@ Once we have our service and our models, can plug them into our viewmodels to co
302302
```csharp
303303
public sealed class SubredditWidgetViewModel : ObservableRecipient
304304
{
305-
/// <summary>
306-
/// Gets the <see cref="IRedditService"/> instance to use.
307-
/// </summary>
308-
private readonly IRedditService RedditService = Ioc.Default.GetRequiredService<IRedditService>();
305+
/// <summary>
306+
/// Gets the <see cref="IRedditService"/> instance to use.
307+
/// </summary>
308+
private readonly IRedditService RedditService = Ioc.Default.GetRequiredService<IRedditService>();
309309

310-
/// <summary>
311-
/// Loads the posts from a specified subreddit.
312-
/// </summary>
313-
private async Task LoadPostsAsync()
314-
{
315-
var response = await RedditService.GetSubredditPostsAsync(SelectedSubreddit);
310+
/// <summary>
311+
/// Loads the posts from a specified subreddit.
312+
/// </summary>
313+
private async Task LoadPostsAsync()
314+
{
315+
var response = await RedditService.GetSubredditPostsAsync(SelectedSubreddit);
316316

317-
Posts.Clear();
317+
Posts.Clear();
318318

319-
foreach (var item in response.Data.Items)
320-
{
321-
Posts.Add(item.Data);
319+
foreach (var item in response.Data.Items)
320+
{
321+
Posts.Add(item.Data);
322+
}
322323
}
323324
}
324325
```

samples/MvvmSampleUwp/MvvmSampleUwp/Assets/docs/Ioc.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class ConsoleLogger : ILogger
4040
private readonly IFileService FileService;
4141
private readonly IConsoleService ConsoleService;
4242

43-
public FileLogger(
43+
public ConsoleLogger(
4444
IFileService fileService,
4545
IConsoleService consoleService)
4646
{
@@ -63,8 +63,8 @@ Ioc.Default.ConfigureServices(services =>
6363
services.AddSingleton<ILogger, ConsoleLogger>();
6464
});
6565

66-
// Retrieve a console logger with constructor injection
67-
ConsoleLogger consoleLogger = Ioc.Default.GetService<ConsoleLogger>();
66+
// Retrieve a logger service with constructor injection
67+
ILogger consoleLogger = Ioc.Default.GetService<ILogger>();
6868
```
6969

7070
The DI service provider will automatically check whether all the necessary services are registered, then it will retrieve them and invoke the constructor for the registered `ILogger` concrete type, to get the instance to return - all done automatically!

samples/MvvmSampleUwp/MvvmSampleUwp/Assets/docs/PuttingThingsTogether.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,24 @@ Once we have our service and our models, can plug them into our viewmodels to co
301301
```csharp
302302
public sealed class SubredditWidgetViewModel : ObservableRecipient
303303
{
304-
/// <summary>
305-
/// Gets the <see cref="IRedditService"/> instance to use.
306-
/// </summary>
307-
private readonly IRedditService RedditService = Ioc.Default.GetRequiredService<IRedditService>();
304+
/// <summary>
305+
/// Gets the <see cref="IRedditService"/> instance to use.
306+
/// </summary>
307+
private readonly IRedditService RedditService = Ioc.Default.GetRequiredService<IRedditService>();
308308

309-
/// <summary>
310-
/// Loads the posts from a specified subreddit.
311-
/// </summary>
312-
private async Task LoadPostsAsync()
313-
{
314-
var response = await RedditService.GetSubredditPostsAsync(SelectedSubreddit);
309+
/// <summary>
310+
/// Loads the posts from a specified subreddit.
311+
/// </summary>
312+
private async Task LoadPostsAsync()
313+
{
314+
var response = await RedditService.GetSubredditPostsAsync(SelectedSubreddit);
315315

316-
Posts.Clear();
316+
Posts.Clear();
317317

318-
foreach (var item in response.Data.Items)
319-
{
320-
Posts.Add(item.Data);
318+
foreach (var item in response.Data.Items)
319+
{
320+
Posts.Add(item.Data);
321+
}
321322
}
322323
}
323324
```

0 commit comments

Comments
 (0)