rainmeter-studio/RainmeterStudio/UI/ViewModel/DocumentTemplateViewModel.cs

65 lines
1.8 KiB
C#
Raw Normal View History

using System.Windows.Media;
using RainmeterStudio.Business;
using RainmeterStudio.Core.Model;
2014-07-29 16:42:52 +00:00
namespace RainmeterStudio.UI.ViewModel
{
/// <summary>
/// View model for document templates
/// </summary>
2014-07-29 16:42:52 +00:00
public class DocumentTemplateViewModel
{
/// <summary>
/// Gets the document template
/// </summary>
public IDocumentTemplate Template { get; private set; }
2014-07-29 16:42:52 +00:00
/// <summary>
/// Gets the document template name
/// </summary>
public string Name { get { return Template.Name; } }
/// <summary>
/// Gets or sets the icon of this document template
/// </summary>
public ImageSource Icon
2014-07-29 16:42:52 +00:00
{
get
{
return ResourceProvider.GetImage("DocumentTemplate_" + Name + "_Icon");
2014-07-29 16:42:52 +00:00
}
}
/// <summary>
/// Gets or sets the display text
/// </summary>
public string DisplayText
{
get
{
return ResourceProvider.GetString("DocumentTemplate_" + Name + "_DisplayText");
2014-07-29 16:42:52 +00:00
}
}
/// <summary>
/// Gets or sets the description of this document template
/// </summary>
public string Description
{
get
{
return ResourceProvider.GetString("DocumentTemplate_" + Name + "_Description");
2014-07-29 16:42:52 +00:00
}
}
/// <summary>
/// Initializes the document template view model
/// </summary>
/// <param name="template">The document template</param>
public DocumentTemplateViewModel(IDocumentTemplate template)
2014-07-29 16:42:52 +00:00
{
this.Template = template;
}
}
}