C00225155-02/C00225155/MegaRobo.C00225155/MegaRobo.C00225155App/App.xaml.cs

60 lines
2.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using CommunityToolkit.Mvvm.Messaging;
using MegaRobo.Contract;
using MegaRobo.Contract.Servers;
using MegaRobo.Entities;
using MegaRobo.Entities.ViewTT;
using MegaRobo.Logger;
using MegaRobo.Logger.Loggers.Database;
using MegaRobo.C00225155.AppServer;
using MegaRobo.C00225155.DataAccess;
using MegaRobo.Utility.TextString;
using MegaRobo.WpfComponents.Servers;
using MegaRobo.WpfInfrastructure.Abstractions;
using MegaRobo.WpfInfrastructure.ResourceBox;
using Telerik.Windows.Controls;
using Common;
namespace MegaRobo.C00225155App
{
/// <summary>
/// App 类继承自 Application是 WPF 应用程序的入口类,在 App.xaml.cs 中定义
/// </summary>
public partial class App
{
/// <summary>
/// 静态属性 Current对 Application.Current 进行了重写,返回当前 App 实例,方便在其他地方获取当前应用程序实例。
/// </summary>
public new static App Current => (App)Application.Current;
/// <summary>
/// 内部字段 CoreService类型为 ICoreService用来存储核心服务实例。
/// </summary>
internal ICoreService CoreService;
/// <summary>
///OnStartup 方法:该方法会在应用程序启动时被调用。
///调用基类的 OnStartup 方法,确保基类的启动逻辑得以执行。
///初始化 CoreService 实例。
///创建 AppService 实例,并传入 CoreService。
///调用 AppService 的 OnStartup 方法,开启应用程序服务的启动流程。
/// </summary>
/// <param name="e"></param>
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
this.CoreService = new CoreService();
var appService = new AppService(this.CoreService);
appService.OnStartup();
// StartupService startupService = new StartupService(this.CoreService);
}
}
}