using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Business;
using RainmeterStudio.UI.Controller;
namespace RainmeterStudio.UI
{
public class UIManager
{
///
/// Gets the WPF app
///
protected App App {get; private set;}
///
/// Gets the project manager
///
protected ProjectManager ProjectManager { get; private set; }
///
/// Gets the document manager
///
protected DocumentManager DocumentManager { get; private set; }
///
/// Initializes the UI manager
///
/// Project manager
/// Document manager
public UIManager(ProjectManager projectManager, DocumentManager documentManager)
{
App = new UI.App();
ProjectManager = projectManager;
DocumentManager = documentManager;
}
///
/// Runs the UI thread
///
public void Run()
{
// Create controllers
ProjectController projectController = new ProjectController(ProjectManager);
DocumentController documentController = new DocumentController(DocumentManager, ProjectManager);
// Create and set up main window
MainWindow mainWindow = new MainWindow(projectController, documentController);
projectController.OwnerWindow = mainWindow;
documentController.OwnerWindow = mainWindow;
mainWindow.Show();
// Run app
App.Run();
}
}
}