Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions App/App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@
</PackageReference>
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CoderSdk\CoderSdk.csproj" />
<ProjectReference Include="..\MutagenSdk\MutagenSdk.csproj" />
<ProjectReference Include="..\Vpn.Proto\Vpn.Proto.csproj" />
<ProjectReference Include="..\Vpn\Vpn.csproj" />
</ItemGroup>
Expand Down
22 changes: 21 additions & 1 deletion App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
using Coder.Desktop.App.ViewModels;
using Coder.Desktop.App.Views;
using Coder.Desktop.App.Views.Pages;
using Coder.Desktop.Vpn;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.UI.Xaml;
using Microsoft.Win32;

namespace Coder.Desktop.App;

Expand All @@ -17,12 +21,28 @@ public partial class App : Application

private bool _handleWindowClosed = true;

#if !DEBUG
private const string MutagenControllerConfigSection = "MutagenController";
#else
private const string MutagenControllerConfigSection = "DebugMutagenController";
#endif

public App()
{
var services = new ServiceCollection();
var builder = Host.CreateApplicationBuilder();

(builder.Configuration as IConfigurationBuilder).Add(
new RegistryConfigurationSource(Registry.LocalMachine, @"SOFTWARE\Coder Desktop"));

var services = builder.Services;

services.AddSingleton<ICredentialManager, CredentialManager>();
services.AddSingleton<IRpcController, RpcController>();

services.AddOptions<MutagenControllerConfig>()
.Bind(builder.Configuration.GetSection(MutagenControllerConfigSection));
services.AddSingleton<ISyncSessionController, MutagenController>();

// SignInWindow views and view models
services.AddTransient<SignInViewModel>();
services.AddTransient<SignInWindow>();
Expand Down
Loading
Loading