init
This commit is contained in:
80
Common/DTS.CommonCore/RibbonControl/Classes/RibbonData.cs
Normal file
80
Common/DTS.CommonCore/RibbonControl/Classes/RibbonData.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace DTS.Common.RibbonControl
|
||||
{
|
||||
public class RibbonData : INotifyPropertyChanged
|
||||
{
|
||||
public ObservableCollection<TabData> TabDataCollection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_tabDataCollection != null) return _tabDataCollection;
|
||||
_tabDataCollection = new ObservableCollection<TabData>();
|
||||
for (int i = ViewModelData.TabCount, j = ViewModelData.ContextualTabGroupCount; i > 0; i--, j--)
|
||||
{
|
||||
if (j > 0)
|
||||
{
|
||||
var contextualTabGroupHeader = ContextualTabGroupDataCollection[j - 1].Header;
|
||||
_tabDataCollection.Insert(0, new TabData("Tab " + i) { ContextualTabGroupHeader = contextualTabGroupHeader });
|
||||
}
|
||||
else
|
||||
{
|
||||
_tabDataCollection.Insert(0, new TabData("Tab " + i));
|
||||
}
|
||||
}
|
||||
return _tabDataCollection;
|
||||
}
|
||||
}
|
||||
private ObservableCollection<TabData> _tabDataCollection;
|
||||
|
||||
public ObservableCollection<ContextualTabGroupData> ContextualTabGroupDataCollection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_contextualTabGroupDataCollection != null) return _contextualTabGroupDataCollection;
|
||||
_contextualTabGroupDataCollection = new ObservableCollection<ContextualTabGroupData>();
|
||||
for (var i = 0; i < ViewModelData.ContextualTabGroupCount; i++)
|
||||
{
|
||||
_contextualTabGroupDataCollection.Add(new ContextualTabGroupData("Grp " + i) { IsVisible = true });
|
||||
}
|
||||
return _contextualTabGroupDataCollection;
|
||||
}
|
||||
}
|
||||
private ObservableCollection<ContextualTabGroupData> _contextualTabGroupDataCollection;
|
||||
|
||||
public MenuButtonData ApplicationMenuData
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_applicationMenuData != null) return _applicationMenuData;
|
||||
var smallImage = new Uri("/Common;component/RibbonControl/Images/Paste_16x16.png", UriKind.Relative);
|
||||
_applicationMenuData = new MenuButtonData(true)
|
||||
{
|
||||
Label = "AppMenu ",
|
||||
SmallImage = smallImage,
|
||||
ToolTipTitle = "ToolTip Title",
|
||||
ToolTipDescription = "ToolTip Description",
|
||||
ToolTipImage = smallImage
|
||||
};
|
||||
return _applicationMenuData;
|
||||
}
|
||||
}
|
||||
private MenuButtonData _applicationMenuData;
|
||||
|
||||
#region INotifyPropertyChanged Members
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected void OnPropertyChanged(PropertyChangedEventArgs e)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
{
|
||||
PropertyChanged(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user