Work on documents, separated UI from Main

This commit is contained in:
2014-07-29 23:35:59 +03:00
parent 09224d9af7
commit 473f23378f
21 changed files with 316 additions and 226 deletions

View File

@ -9,6 +9,7 @@ using RainmeterStudio.Model;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using RainmeterStudio.Documents;
namespace RainmeterStudio.UI.Controller
{
@ -34,18 +35,23 @@ namespace RainmeterStudio.UI.Controller
#endregion
/// <summary>
/// Triggered when a document is opened
/// </summary>
public event EventHandler<DocumentOpenedEventArgs> DocumentOpened
{
add
{
DocumentManager.DocumentOpened += value;
}
remove
{
DocumentManager.DocumentOpened -= value;
}
add { DocumentManager.DocumentOpened += value; }
remove { DocumentManager.DocumentOpened -= value; }
}
/// <summary>
/// Triggered when a document is closed
/// </summary>
public event EventHandler<DocumentClosedEventArgs> DocumentClosed
{
add { DocumentManager.DocumentClosed += value; }
remove { DocumentManager.DocumentClosed -= value; }
}
public event EventHandler DocumentClosed;
public Window OwnerWindow { get; set; }
@ -63,7 +69,7 @@ namespace RainmeterStudio.UI.Controller
var dialog = new CreateDocumentDialog()
{
Owner = OwnerWindow,
SelectedFormat = defaultFormat,
SelectedTemplate = defaultFormat,
SelectedPath = defaultPath
};
bool? res = dialog.ShowDialog();
@ -71,7 +77,7 @@ namespace RainmeterStudio.UI.Controller
if (!res.HasValue || !res.Value)
return;
var format = dialog.SelectedFormat;
var format = dialog.SelectedTemplate;
var path = dialog.SelectedPath;
// Call manager