49 lines
2.0 KiB
Plaintext
49 lines
2.0 KiB
Plaintext
|
|
using System;
|
||
|
|
using System.Collections.ObjectModel;
|
||
|
|
using System.ComponentModel;
|
||
|
|
|
||
|
|
namespace DTS.Common.RibbonControl
|
||
|
|
{
|
||
|
|
public class GalleryCategoryData : ControlData
|
||
|
|
{
|
||
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||
|
|
public ObservableCollection<GalleryItemData> GalleryItemDataCollection
|
||
|
|
{
|
||
|
|
get
|
||
|
|
{
|
||
|
|
if (_controlDataCollection == null)
|
||
|
|
{
|
||
|
|
_controlDataCollection = new ObservableCollection<GalleryItemData>();
|
||
|
|
|
||
|
|
var smallImage = new Uri("/Common;component/RibbonControl/Images/Paste_16x16.png", UriKind.Relative);
|
||
|
|
var largeImage = new Uri("/Common;component/RibbonControl/Images/Paste_32x32.png", UriKind.Relative);
|
||
|
|
|
||
|
|
for (var i = 0; i < ViewModelData.GalleryItemCount; i++)
|
||
|
|
{
|
||
|
|
_controlDataCollection.Add(new GalleryItemData()
|
||
|
|
{
|
||
|
|
Label = "GalleryItem " + i,
|
||
|
|
SmallImage = smallImage,
|
||
|
|
LargeImage = largeImage,
|
||
|
|
ToolTipTitle = "ToolTip Title",
|
||
|
|
ToolTipDescription = "ToolTip Description",
|
||
|
|
ToolTipImage = smallImage,
|
||
|
|
Command = ViewModelData.DefaultCommand
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return _controlDataCollection;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
private ObservableCollection<GalleryItemData> _controlDataCollection;
|
||
|
|
}
|
||
|
|
|
||
|
|
public class GalleryCategoryData<T> : ControlData
|
||
|
|
{
|
||
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||
|
|
public ObservableCollection<T> GalleryItemDataCollection => _controlDataCollection ?? (_controlDataCollection = new ObservableCollection<T>());
|
||
|
|
|
||
|
|
private ObservableCollection<T> _controlDataCollection;
|
||
|
|
}
|
||
|
|
}
|