Продолжение рефакторинга (вынесение WPF в отдельный проект)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using Pf2e.Database;
|
||||
using Pf2e.Database.Model.Enum;
|
||||
using Pf2e.Scrapper.WPF.EntityViewer.ViewModel;
|
||||
|
||||
namespace Pf2e.WPF.EntityViewer;
|
||||
|
||||
internal partial class EntityForm : Window
|
||||
{
|
||||
public Pf2eDbContext Context { get; }
|
||||
public EntityFormViewModel ViewModel { get; }
|
||||
|
||||
public EntityForm(Pf2eDbContext context, EntityFormViewModel viewModel)
|
||||
{
|
||||
Context = context;
|
||||
ViewModel = viewModel;
|
||||
InitializeComponent();
|
||||
|
||||
EntityListControl.DataContext = ViewModel.DbEntityListViewModel;
|
||||
ViewControl.DataContext = ViewModel.ViewViewModel;
|
||||
|
||||
DataContext = ViewModel;
|
||||
|
||||
ViewModel.DbEntityListViewModel.Reload();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e) { }
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ApplicationStateChange?.Invoke(this, ApplicationStage.InitialSettings);
|
||||
}
|
||||
|
||||
public event ImportApplication.ApplicationStateChangeDelegate? ApplicationStateChange;
|
||||
}
|
||||
Reference in New Issue
Block a user