Hi everyone,
after I have talked to Cesar De la Torre on the .NET Blog he suggested that I should open a new issue here.
The .NET Blog post:
https://blogs.msdn.microsoft.com/dotnet/2017/11/01/modernize-existing-net-apps-with-windows-containers-and-azure/#comments
I like the project as it helps to get started building enterpries applications with microsofts UWP.
Following areas could be improved in my opninion:
- Make the ViewModels portable
Right now the ViewModel classes depend on the UWP UI stack.
e.g. ShellViewModel is referencing Windows.UI namespaces.
Therefore VM’s are not portable to use them with other UI technologies.
I suggest to move ViewModels into a separate .NET Standard 2.0 project and abstract the UI dependencies away.
In general I personally try to put most of my code into .NET Standard projects as long as there is no real need for a platform specific dependency.
- Use Dependency Injection instead of Service Location
In my opinion Dependency Injection is a cleaner way of resolving dependencies as a class must tell the consumer on which other classes it has a dependency on and the consumer must provide them in one way or another.
The class does not have to resolve it's dependencies by itself.
This makes passing mock implementations in unit tests easy.
With a Service Locator on the other side, the class has to resolve it's dependencies by itself (using the locator)
- Show us how to extend the application (Modules / Extensions ...)
In classic .NET applications we can easily extend our applications as we have full access to Reflection API's.
As far as I know Assembly.Load( ) is not available for UWP applications.
https://docs.microsoft.com/en-us/windows/uwp/launch-resume/extend-your-app-with-services-extensions-packages
In-proc code plugins are only supported in C++ as it seems.
Will such scenarios be possible with c# in a future UWP release?
I think a sample on how to extend a UWP app would be great for this sample app.
Best regards
SariDev