Initial commit

This commit is contained in:
2026-09-19 16:13:20 +03:00 Unverified
commit d60d5b98d4
24 changed files with 1278 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using IPClab3.Services;
using IPClab3.ViewModels;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Shapes;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace IPClab3;
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : Application
{
public static IServiceProvider Services
{
get;
private set;
}
private Window? _window;
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
InitializeComponent();
Services = ConfigureServices();
}
/// <summary>
/// Invoked when the application is launched.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
_window = Services.GetRequiredService<MainWindow>();
_window.Activate();
}
private static ServiceProvider ConfigureServices()
{
var services = new ServiceCollection();
services.AddTransient<FilePickerService>();
services.AddTransient<ProcessHackerService>();
services.AddTransient<MainWindow>();
services.AddTransient<MainWindowViewModel>();
return services.BuildServiceProvider();
}
}