CommunityToolkit / CommunityToolkit/MVVM-Samples
Docs - Services in "Putting things together"
- Dominant language
- No language data
- Stars
- 1.4k
- Forks
- 265
- PR merge metrics
- No merged PRs in 30d
Description
The [Putting things together](https://github.com/windows-toolkit/MVVM-Samples/blob/master/docs/mvvm/PuttingThingsTogether.md) page describes how to make and implement services, but it doesn't explain how to use them. The [Building the UI](https://github.com/windows-toolkit/MVVM-Samples/blob/master/docs/mvvm/PuttingThingsTogether.md) section gives a sample, but it doesn't work.
1. `App.Current` doesn't have a `Services` property. I discovered in #22 that you have to cast it like this `((App)Application.Current).Services` to access it.
2. The code included at the end of the previous section doesn't seem to set the `Services` property. When I tried the above fix in the constructor of my MainPage, `Services` was null.
3. `IServiceProvider` doesn't have a `GetService()` method in the latest version of `Microsoft.Extensions.DependencyInjection` (5.0.0). It seems to have been changed to `GetService(Type serviceType)`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.