MVVM-Samples
MVVM-Samples copied to clipboard
Docs - Services in "Putting things together"
The Putting things together page describes how to make and implement services, but it doesn't explain how to use them. The Building the UI section gives a sample, but it doesn't work.
-
App.Currentdoesn't have aServicesproperty. I discovered in #22 that you have to cast it like this((App)Application.Current).Servicesto access it. - The code included at the end of the previous section doesn't seem to set the
Servicesproperty. When I tried the above fix in the constructor of my MainPage,Serviceswas null. -
IServiceProviderdoesn't have aGetService<T>()method in the latest version ofMicrosoft.Extensions.DependencyInjection(5.0.0). It seems to have been changed toGetService(Type serviceType).