From ea0111777227234587d626c9fa84e278d71a40de Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:48:25 +0200 Subject: [PATCH] Mention Avalonia related extensions in Getting started --- docs/GettingStarted.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 6c92fd216d..e12d8096e7 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -11,6 +11,17 @@ To start with, you'll want to download the .NET 7 SDK (https://dotnet.microsoft. All other code and library dependencies are handled by NuGet and will be downloaded automatically when the application is built. There are no other language or runtime dependencies. +### Useful tools: +Visual Studio and JetBrains Rider both have avalonia extensions that allow previewing ui designs (.axaml files). +- Visual Studio: https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaVS +- Rider: https://plugins.jetbrains.com/plugin/14839-avaloniarider + +Both extensions can be found directly from the IDE plugin/extension managers. +Using these extension is recommended for easier development. + +There are also some project Templates for Avalonia that can be very useful to have, available here: +- https://github.com/AvaloniaUI/avalonia-dotnet-templates + ### Code Overview The NexusMods.App makes heavy use of Microsoft Dependency Injection. During application startup, modules are added to a `IServiceCollection` tagged by one or more type names. In may places in the code, you can see many examples of this registration @@ -18,12 +29,12 @@ The NexusMods.App makes heavy use of Microsoft Dependency Injection. During appl ```csharp services.AddSingleton() // Register Foo as a provider of the Foo type servcies.AddSingleton() // Register Foo as a provider of the IFoo interface -services.AddAllSingleton, Foo>() // Register Foo as a provider of +services.AddAllSingleton, Foo>() // Register Foo as a provider of ``` -Once the application starts, a `IServiceProvider` is created which can be used to get instances of registered types. This provider also auto-resolves all the requirements of classes and injects instances into classes as it constructs them. +Once the application starts, a `IServiceProvider` is created which can be used to get instances of registered types. This provider also auto-resolves all the requirements of classes and injects instances into classes as it constructs them. Coding against interfaces then allows for parts of the application to be stubbed out during testing, swapped out to meet future requirements, or to have different configurations of the application for different environments. -Because `IServiceProvider` can also resolve a collection of implementations, it's possible to get all the possible implementations of a iterfaces. For example `services.GetRequiredService>()` +Because `IServiceProvider` can also resolve a collection of implementations, it's possible to get all the possible implementations of a iterfaces. For example `services.GetRequiredService>()` will return all the registered implementations of `IGame`. This is used in many places in the application to allow for the application to be extended to support new games without needing to change the code in many places. -This behavior is also leveraged to allow libraries to hook aspects of the application without having to register event callbacks. Instead libraries register themselves in the DI system and the framework calls them as needed. \ No newline at end of file +This behavior is also leveraged to allow libraries to hook aspects of the application without having to register event callbacks. Instead libraries register themselves in the DI system and the framework calls them as needed.