2025-03-18 21:01:15 +08:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Serein.Workbench.ViewModels
|
|
|
|
|
|
{
|
|
|
|
|
|
internal class Locator
|
|
|
|
|
|
{
|
|
|
|
|
|
private static IServiceProvider ServiceProvide { get; set; }
|
|
|
|
|
|
public Locator(IServiceProvider serviceProvider)
|
|
|
|
|
|
{
|
|
|
|
|
|
ServiceProvider = serviceProvider;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-27 23:46:06 +08:00
|
|
|
|
|
2025-03-18 21:01:15 +08:00
|
|
|
|
public MainViewModel MainViewModel => App.GetService<MainViewModel>() ?? throw new NotImplementedException();
|
|
|
|
|
|
public MainMenuBarViewModel MainMenuBarViewModel => App.GetService<MainMenuBarViewModel>() ?? throw new NotImplementedException();
|
|
|
|
|
|
public FlowWorkbenchViewModel FlowWorkbenchViewModel => App.GetService<FlowWorkbenchViewModel>() ?? throw new NotImplementedException();
|
|
|
|
|
|
public BaseNodesViewModel BaseNodesViewModel => App.GetService<BaseNodesViewModel>() ?? throw new NotImplementedException();
|
|
|
|
|
|
public FlowLibrarysViewModel FlowLibrarysViewModel => App.GetService<FlowLibrarysViewModel>() ?? throw new NotImplementedException();
|
|
|
|
|
|
public FlowEditViewModel FlowEditViewModel => App.GetService<FlowEditViewModel>() ?? throw new NotImplementedException();
|
2025-05-27 23:46:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-18 21:01:15 +08:00
|
|
|
|
public FlowCanvasViewModel FlowCanvasViewModel => App.GetService<FlowCanvasViewModel>() ?? throw new NotImplementedException();
|
2025-05-27 23:46:06 +08:00
|
|
|
|
public CanvasInfoViewModel CanvasNodeTreeViewModel => App.GetService<CanvasInfoViewModel>() ?? throw new NotImplementedException();
|
2025-03-18 21:01:15 +08:00
|
|
|
|
|
|
|
|
|
|
public IServiceProvider ServiceProvider { get; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|