Refactor application structure and add database support
Changed App.xaml.cs to implement dependency injection with Microsoft.Extensions.Hosting, initializing services for LandingWindow and LandingViewModel. Removed MainWindow.xaml and MainWindow.xaml.cs, shifting to a new landing window structure. Added Ghost.Database project with necessary database functionality and created ProjectRepository for project management. Added ProjectInfo and TemplateInfo data models for project attributes. Added CreateProjectViewModel and LandingViewModel for managing view models using Community Toolkit for MVVM. Created new XAML pages for project creation, opening projects, and the landing window, along with their corresponding code-behind files. Added AssemblyInfo.cs for internal visibility to facilitate testing.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Ghost.Database.Models.Projects;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Ghost.Editor.ViewModel.Pages.Landing;
|
||||
|
||||
internal partial class CreateProjectViewModel : ObservableRecipient
|
||||
{
|
||||
public ObservableCollection<TemplateInfo> templates = new();
|
||||
|
||||
[ObservableProperty]
|
||||
public partial TemplateInfo SelectedTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
13
Ghost.Editor/ViewModel/Windows/LandingViewModel.cs
Normal file
13
Ghost.Editor/ViewModel/Windows/LandingViewModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Ghost.Editor.ViewModel.Windows;
|
||||
|
||||
internal partial class LandingViewModel : ObservableRecipient
|
||||
{
|
||||
[ObservableProperty]
|
||||
public partial int TabIndex
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user