Refactor activation handling and introduce entity system

Added new `ActivationHandler` class for folder initialization.
Added `ProjectService` class for project-related operations.
Added `Ghost.Entities` project with entity management classes.
Added `EngineEditorWindow` for enhanced user interface.

Changed project files to restructure dependencies and remove unused references.
Changed `ProjectRepository` to use asynchronous methods for improved performance.
Changed data binding in `CreateProjectPage.xaml` and `OpenProjectPage.xaml` to use new data models.
Changed `App.xaml.cs` to utilize the new `ActivationHandler` and include additional services.

Removed `IActivationHandler` interface and integrated its functionality into `ActivationHandler`.
Removed `EditorActivationHandler` as its functionality was merged into `ActivationHandler`.

Updated `AssemblyInfo.cs` to include global using directives for entity types.
Updated image assets to reflect visual resource changes.
This commit is contained in:
2025-03-27 00:52:07 +09:00
parent 02b3edcd7a
commit 62fe30ff2b
47 changed files with 711 additions and 231 deletions

View File

@@ -1,7 +1,8 @@
using Ghost.Database.DataContext;
using Ghost.Database.Models.Projects;
using Ghost.Data.Models;
using Ghost.Data.Services;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
using System.Collections.ObjectModel;
// To learn more about WinUI, the WinUI project structure,
@@ -11,17 +12,24 @@ namespace Ghost.Editor.View.Pages.Landing;
internal sealed partial class OpenProjectPage : Page
{
private readonly ProjectService _projectService;
public readonly ObservableCollection<ProjectInfo> projects = new();
public OpenProjectPage()
{
foreach (var project in ProjectRepository.LoadProjects())
_projectService = App.GetService<ProjectService>();
InitializeComponent();
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
await foreach (var project in _projectService.LoadProjectAsync())
{
projects.Add(project);
}
InitializeComponent();
if (projects.Count == 0)
{
PlaceHolderText.Visibility = Visibility.Visible;