diff --git a/RainmeterStudio.Core/Editor/Features/IToolboxProvider.cs b/RainmeterStudio.Core/Editor/Features/IToolboxProvider.cs index aed75dee..a033c146 100644 --- a/RainmeterStudio.Core/Editor/Features/IToolboxProvider.cs +++ b/RainmeterStudio.Core/Editor/Features/IToolboxProvider.cs @@ -2,14 +2,29 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Windows; namespace RainmeterStudio.Core.Editor.Features { + /// + /// Editor provides toolbox items + /// public interface IToolboxProvider { - bool SupportsToolboxDrop { get; } - IEnumerable ToolboxItems { get; } + /// + /// Gets a list of toolbox items + /// + IEnumerable ToolboxItems { get; } + /// + /// Triggered if the toolbox items change + /// event EventHandler ToolboxItemsChanged; + + /// + /// Called when a toolbar item is dropped by double-click + /// + /// Toolbox item dropped + void ToolboxItemDrop(ToolboxItem item); } } diff --git a/RainmeterStudio.Core/Editor/Features/ToolboxItem.cs b/RainmeterStudio.Core/Editor/Features/ToolboxItem.cs new file mode 100644 index 00000000..6bf42f8c --- /dev/null +++ b/RainmeterStudio.Core/Editor/Features/ToolboxItem.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RainmeterStudio.Core.Editor.Features +{ + public class ToolboxItem + { + public string Name { get; private set; } + + public ToolboxItem(string name) + { + Name = name; + } + } +} diff --git a/RainmeterStudio/UI/ViewModel/ToolboxItemViewModel.cs b/RainmeterStudio/UI/ViewModel/ToolboxItemViewModel.cs new file mode 100644 index 00000000..d6b73bfd --- /dev/null +++ b/RainmeterStudio/UI/ViewModel/ToolboxItemViewModel.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using RainmeterStudio.Core.Editor.Features; + +namespace RainmeterStudio.UI.ViewModel +{ + public class ToolboxItemViewModel + { + /// + /// Gets the toolbox item + /// + public ToolboxItem Item { get; private set; } + + /// + /// Gets the display text of the toolbox item + /// + public string DisplayText + { + get + { + return Item.Name; + } + } + + /// + /// Gets the tooltip text of the toolbox item + /// + public string ToolTip + { + get + { + return "Placeholder tooltip for " + Item.Name; + } + } + + /// + /// Gets the icon + /// + public ImageSource Icon + { + get + { + return null; + } + } + + /// + /// Initializes the toolbox item view model + /// + /// + public ToolboxItemViewModel(ToolboxItem item) + { + Item = item; + } + } +}