init
This commit is contained in:
97
Common/DTS.CommonCore/RibbonControl/Classes/TabData.cs
Normal file
97
Common/DTS.CommonCore/RibbonControl/Classes/TabData.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace DTS.Common.RibbonControl
|
||||
{
|
||||
public class TabData : INotifyPropertyChanged
|
||||
{
|
||||
public TabData()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
public TabData(string header)
|
||||
{
|
||||
Header = header;
|
||||
}
|
||||
|
||||
public string Header
|
||||
{
|
||||
get => _header;
|
||||
|
||||
set
|
||||
{
|
||||
if (_header == value) return;
|
||||
_header = value;
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("Header"));
|
||||
}
|
||||
}
|
||||
private string _header;
|
||||
|
||||
public string ContextualTabGroupHeader
|
||||
{
|
||||
get => _contextualTabGroupHeader;
|
||||
|
||||
set
|
||||
{
|
||||
if (_contextualTabGroupHeader == value) return;
|
||||
_contextualTabGroupHeader = value;
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("ContextualTabGroupHeader"));
|
||||
}
|
||||
}
|
||||
private string _contextualTabGroupHeader;
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get => _isSelected;
|
||||
|
||||
set
|
||||
{
|
||||
if (_isSelected == value) return;
|
||||
_isSelected = value;
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("IsSelected"));
|
||||
}
|
||||
}
|
||||
private bool _isSelected;
|
||||
|
||||
public ObservableCollection<GroupData> GroupDataCollection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_groupDataCollection == null)
|
||||
{
|
||||
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);
|
||||
|
||||
_groupDataCollection = new ObservableCollection<GroupData>();
|
||||
for (var i = 0; i < ViewModelData.GroupCount; i++)
|
||||
{
|
||||
_groupDataCollection.Add(new GroupData("Group " + i)
|
||||
{
|
||||
LargeImage = largeImage,
|
||||
SmallImage = smallImage
|
||||
});
|
||||
}
|
||||
}
|
||||
return _groupDataCollection;
|
||||
}
|
||||
}
|
||||
private ObservableCollection<GroupData> _groupDataCollection;
|
||||
|
||||
#region INotifyPropertyChanged Members
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private void OnPropertyChanged(PropertyChangedEventArgs e)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
{
|
||||
PropertyChanged(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user