This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
namespace DTS.Common.RibbonControl
{
public class ApplicationMenuItemData : MenuItemData
{
public ApplicationMenuItemData()
: this(false)
{
}
public ApplicationMenuItemData(bool isApplicationMenu)
: base(isApplicationMenu)
{
}
}
}

View File

@@ -0,0 +1,16 @@
namespace DTS.Common.RibbonControl
{
public class ApplicationSplitMenuItemData : SplitMenuItemData
{
public ApplicationSplitMenuItemData()
: this(false)
{
}
public ApplicationSplitMenuItemData(bool isApplicationMenu)
: base(isApplicationMenu)
{
}
}
}

View File

@@ -0,0 +1,7 @@
namespace DTS.Common.RibbonControl
{
public class ButtonData : ControlData
{
}
}

View File

@@ -0,0 +1,20 @@
using System.ComponentModel;
namespace DTS.Common.RibbonControl
{
public class CheckBoxData : ControlData
{
public bool IsChecked
{
get => _isChecked;
set
{
if (_isChecked == value) return;
_isChecked = value;
OnPropertyChanged(new PropertyChangedEventArgs("IsChecked"));
}
}
private bool _isChecked;
}
}

View File

@@ -0,0 +1,7 @@
namespace DTS.Common.RibbonControl
{
public class ComboBoxData : MenuButtonData
{
}
}

View File

@@ -0,0 +1,62 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
namespace DTS.Common.RibbonControl
{
public class ContextualTabGroupData : INotifyPropertyChanged
{
public ContextualTabGroupData()
: this(null)
{
}
public ContextualTabGroupData(string header)
{
Header = header;
}
public string Header
{
get => _header;
set
{
if (_header == value) return;
_header = value;
OnPropertyChanged(new PropertyChangedEventArgs("Header"));
}
}
private string _header;
public bool IsVisible
{
get => _isVisible;
set
{
if (_isVisible == value) return;
_isVisible = value;
OnPropertyChanged(new PropertyChangedEventArgs("IsVisible"));
}
}
private bool _isVisible;
public ObservableCollection<TabData> TabDataCollection => _tabDataCollection ?? (_tabDataCollection = new ObservableCollection<TabData>());
private ObservableCollection<TabData> _tabDataCollection;
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(PropertyChangedEventArgs e)
{
if (PropertyChanged != null)
{
PropertyChanged(this, e);
}
}
#endregion
}
}

View File

@@ -0,0 +1,188 @@
using System;
using System.ComponentModel;
using System.Windows.Input;
namespace DTS.Common.RibbonControl
{
public class ControlData : INotifyPropertyChanged
{
public string Label
{
get => _label;
set
{
if (_label != value)
{
_label = value;
OnPropertyChanged(new PropertyChangedEventArgs("Label"));
}
}
}
private string _label;
public Uri LargeImage
{
get => _largeImage;
set
{
if (_largeImage != value)
{
_largeImage = value;
OnPropertyChanged(new PropertyChangedEventArgs("LargeImage"));
}
}
}
private Uri _largeImage;
public Uri SmallImage
{
get => _smallImage;
set
{
if (_smallImage != value)
{
_smallImage = value;
OnPropertyChanged(new PropertyChangedEventArgs("SmallImage"));
}
}
}
private Uri _smallImage;
public string ToolTipTitle
{
get => _toolTipTitle;
set
{
if (_toolTipTitle != value)
{
_toolTipTitle = value;
OnPropertyChanged(new PropertyChangedEventArgs("ToolTipTitle"));
}
}
}
private string _toolTipTitle;
public string ToolTipDescription
{
get => _toolTipDescription;
set
{
if (_toolTipDescription != value)
{
_toolTipDescription = value;
OnPropertyChanged(new PropertyChangedEventArgs("ToolTipDescription"));
}
}
}
private string _toolTipDescription;
public Uri ToolTipImage
{
get => _toolTipImage;
set
{
if (_toolTipImage != value)
{
_toolTipImage = value;
OnPropertyChanged(new PropertyChangedEventArgs("ToolTipImage"));
}
}
}
private Uri _toolTipImage;
public string ToolTipFooterTitle
{
get => _toolTipFooterTitle;
set
{
if (_toolTipFooterTitle != value)
{
_toolTipFooterTitle = value;
OnPropertyChanged(new PropertyChangedEventArgs("ToolTipFooterTitle"));
}
}
}
private string _toolTipFooterTitle;
public string ToolTipFooterDescription
{
get => _toolTipFooterDescription;
set
{
if (_toolTipFooterDescription != value)
{
_toolTipFooterDescription = value;
OnPropertyChanged(new PropertyChangedEventArgs("ToolTipFooterDescription"));
}
}
}
private string _toolTipFooterDescription;
public Uri ToolTipFooterImage
{
get => _toolTipFooterImage;
set
{
if (_toolTipFooterImage != value)
{
_toolTipFooterImage = value;
OnPropertyChanged(new PropertyChangedEventArgs("ToolTipFooterImage"));
}
}
}
private Uri _toolTipFooterImage;
public ICommand Command
{
get => _command;
set
{
if (_command != value)
{
_command = value;
OnPropertyChanged(new PropertyChangedEventArgs("Command"));
}
}
}
private ICommand _command;
public string KeyTip
{
get => _keyTip;
set
{
if (_keyTip != value)
{
_keyTip = value;
OnPropertyChanged(new PropertyChangedEventArgs("KeyTip"));
}
}
}
private string _keyTip;
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(PropertyChangedEventArgs e)
{
if (PropertyChanged != null)
{
PropertyChanged(this, e);
}
}
#endregion
}
}

View File

@@ -0,0 +1,48 @@
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;
}
}

View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
namespace DTS.Common.RibbonControl
{
public class GalleryData : ControlData
{
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public ObservableCollection<GalleryCategoryData> CategoryDataCollection
{
get
{
if (_controlDataCollection != null) return _controlDataCollection;
_controlDataCollection = new ObservableCollection<GalleryCategoryData>();
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.GalleryCategoryCount; i++)
{
_controlDataCollection.Add(new GalleryCategoryData()
{
Label = "GalleryCategory " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand
});
}
return _controlDataCollection;
}
}
private ObservableCollection<GalleryCategoryData> _controlDataCollection;
public GalleryItemData SelectedItem
{
get => _selectedItem;
set
{
if (_selectedItem != value)
{
_selectedItem = value;
OnPropertyChanged(new PropertyChangedEventArgs("SelectedItem"));
}
}
}
GalleryItemData _selectedItem;
public bool CanUserFilter
{
get => _canUserFilter;
set
{
if (_canUserFilter == value) return;
_canUserFilter = value;
OnPropertyChanged(new PropertyChangedEventArgs("CanUserFilter"));
}
}
private bool _canUserFilter;
}
public class GalleryData<T> : ControlData
{
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public ObservableCollection<GalleryCategoryData<T>> CategoryDataCollection => _controlDataCollection ?? (_controlDataCollection = new ObservableCollection<GalleryCategoryData<T>>());
private ObservableCollection<GalleryCategoryData<T>> _controlDataCollection;
public T SelectedItem
{
get => _selectedItem;
set
{
if (Equals(value, _selectedItem)) return;
_selectedItem = value;
OnPropertyChanged(new PropertyChangedEventArgs("SelectedItem"));
}
}
T _selectedItem;
public bool CanUserFilter
{
get => _canUserFilter;
set
{
if (_canUserFilter == value) return;
_canUserFilter = value;
OnPropertyChanged(new PropertyChangedEventArgs("CanUserFilter"));
}
}
private bool _canUserFilter;
}
}

View File

@@ -0,0 +1,7 @@
namespace DTS.Common.RibbonControl
{
public class GalleryItemData : ControlData
{
}
}

View File

@@ -0,0 +1,138 @@
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
namespace DTS.Common.RibbonControl
{
public class GroupData : ControlData
{
public GroupData(string header)
{
Label = header;
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public ObservableCollection<ControlData> ControlDataCollection
{
get
{
if (_controlDataCollection == null)
{
_controlDataCollection = new ObservableCollection<ControlData>();
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.ButtonCount; i++)
{
_controlDataCollection.Add(new ButtonData()
{
Label = "Button " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand
});
}
for (var i = 0; i < ViewModelData.ToggleButtonCount; i++)
{
_controlDataCollection.Add(new ToggleButtonData()
{
Label = "ToggleButton " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand
});
}
for (var i = 0; i < ViewModelData.RadioButtonCount; i++)
{
_controlDataCollection.Add(new RadioButtonData()
{
Label = "RadioButton " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand
});
}
for (var i = 0; i < ViewModelData.CheckBoxCount; i++)
{
_controlDataCollection.Add(new CheckBoxData()
{
Label = "CheckBox " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand
});
}
for (var i = 0; i < ViewModelData.TextBoxCount; i++)
{
_controlDataCollection.Add(new TextBoxData()
{
Label = "TextBox " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand
});
}
for (var i = 0; i < ViewModelData.MenuButtonCount; i++)
{
_controlDataCollection.Add(new MenuButtonData()
{
Label = "MenuButton " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand
});
}
for (var i = 0; i < ViewModelData.SplitButtonCount; i++)
{
_controlDataCollection.Add(new SplitButtonData()
{
Label = "SplitButton " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand,
IsCheckable = true
});
}
for (var i = 0; i < ViewModelData.ComboBoxCount; i++)
{
_controlDataCollection.Add(new ComboBoxData()
{
Label = "ComboBox " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand
});
}
}
return _controlDataCollection;
}
}
private ObservableCollection<ControlData> _controlDataCollection;
}
}

View File

@@ -0,0 +1,118 @@
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
namespace DTS.Common.RibbonControl
{
public class MenuButtonData : ControlData
{
public MenuButtonData()
: this(false)
{
}
public MenuButtonData(bool isApplicationMenu)
{
_isApplicationMenu = isApplicationMenu;
}
public bool IsVerticallyResizable
{
get => _isVerticallyResizable;
set
{
if (_isVerticallyResizable == value) return;
_isVerticallyResizable = value;
OnPropertyChanged(new PropertyChangedEventArgs("IsVerticallyResizable"));
}
}
public bool IsHorizontallyResizable
{
get => _isHorizontallyResizable;
set
{
if (_isHorizontallyResizable == value) return;
_isHorizontallyResizable = value;
OnPropertyChanged(new PropertyChangedEventArgs("IsHorizontallyResizable"));
}
}
private bool _isVerticallyResizable, _isHorizontallyResizable;
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public ObservableCollection<ControlData> ControlDataCollection
{
get
{
if (_controlDataCollection == null)
{
_controlDataCollection = new ObservableCollection<ControlData>();
if (_nestingDepth <= ViewModelData.MenuItemNestingCount)
{
_nestingDepth++;
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.GalleryCount; i++)
{
var galleryData = new GalleryData()
{
Label = "Gallery " + i,
SmallImage = smallImage,
LargeImage = largeImage,
ToolTipTitle = "ToolTip Title",
ToolTipDescription = "ToolTip Description",
ToolTipImage = smallImage,
Command = ViewModelData.DefaultCommand
};
galleryData.SelectedItem = galleryData.CategoryDataCollection[0].GalleryItemDataCollection[ViewModelData.GalleryItemCount - 1];
_controlDataCollection.Add(galleryData);
}
for (var i = 0; i < ViewModelData.MenuItemCount; i++)
{
var menuItemData = _isApplicationMenu ? new ApplicationMenuItemData(true) : new MenuItemData(false);
menuItemData.Label = "MenuItem " + i;
menuItemData.SmallImage = smallImage;
menuItemData.LargeImage = largeImage;
menuItemData.ToolTipTitle = "ToolTip Title";
menuItemData.ToolTipDescription = "ToolTip Description";
menuItemData.ToolTipImage = smallImage;
menuItemData.Command = ViewModelData.DefaultCommand;
menuItemData._nestingDepth = _nestingDepth;
_controlDataCollection.Add(menuItemData);
}
_controlDataCollection.Add(new SeparatorData());
for (var i = 0; i < ViewModelData.SplitMenuItemCount; i++)
{
var splitMenuItemData = _isApplicationMenu ? new ApplicationSplitMenuItemData(true) : new SplitMenuItemData(false);
splitMenuItemData.Label = "SplitMenuItem " + i;
splitMenuItemData.SmallImage = smallImage;
splitMenuItemData.LargeImage = largeImage;
splitMenuItemData.ToolTipTitle = "ToolTip Title";
splitMenuItemData.ToolTipDescription = "ToolTip Description";
splitMenuItemData.ToolTipImage = smallImage;
splitMenuItemData.Command = ViewModelData.DefaultCommand;
splitMenuItemData._nestingDepth = _nestingDepth;
splitMenuItemData.IsCheckable = true;
_controlDataCollection.Add(splitMenuItemData);
}
}
}
return _controlDataCollection;
}
}
private ObservableCollection<ControlData> _controlDataCollection;
private int _nestingDepth;
private bool _isApplicationMenu;
}
}

View File

@@ -0,0 +1,15 @@
namespace DTS.Common.RibbonControl
{
public class MenuItemData : SplitButtonData
{
public MenuItemData()
: this(false)
{
}
public MenuItemData(bool isApplicationMenu)
: base(isApplicationMenu)
{
}
}
}

View File

@@ -0,0 +1,20 @@
using System.ComponentModel;
namespace DTS.Common.RibbonControl
{
public class RadioButtonData : ControlData
{
public bool IsChecked
{
get => _isChecked;
set
{
if (_isChecked == value) return;
_isChecked = value;
OnPropertyChanged(new PropertyChangedEventArgs("IsChecked"));
}
}
private bool _isChecked;
}
}

View 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
}
}

View File

@@ -0,0 +1,7 @@
namespace DTS.Common.RibbonControl
{
public class SeparatorData : ControlData
{
}
}

View File

@@ -0,0 +1,48 @@
using System.ComponentModel;
namespace DTS.Common.RibbonControl
{
public class SplitButtonData : MenuButtonData
{
public SplitButtonData()
: this(false)
{
}
public SplitButtonData(bool isApplicationMenu)
: base(isApplicationMenu)
{
}
public bool IsChecked
{
get => _isChecked;
set
{
if (_isChecked != value)
{
_isChecked = value;
OnPropertyChanged(new PropertyChangedEventArgs("IsChecked"));
}
}
}
private bool _isChecked;
public bool IsCheckable
{
get => _isCheckable;
set
{
if (_isCheckable == value) return;
_isCheckable = value;
OnPropertyChanged(new PropertyChangedEventArgs("IsCheckable"));
}
}
private bool _isCheckable;
public ButtonData DropDownButtonData => _dropDownButtonData ?? (_dropDownButtonData = new ButtonData());
private ButtonData _dropDownButtonData;
}
}

View File

@@ -0,0 +1,16 @@
namespace DTS.Common.RibbonControl
{
public class SplitMenuItemData : MenuItemData
{
public SplitMenuItemData()
: this(false)
{
}
public SplitMenuItemData(bool isApplicationMenu)
: base(isApplicationMenu)
{
}
}
}

View 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
}
}

View File

@@ -0,0 +1,20 @@
using System.ComponentModel;
namespace DTS.Common.RibbonControl
{
public class TextBoxData : ControlData
{
public string Text
{
get => _text;
set
{
if (_text == value) return;
_text = value;
OnPropertyChanged(new PropertyChangedEventArgs("Text"));
}
}
private string _text;
}
}

View File

@@ -0,0 +1,20 @@
using System.ComponentModel;
namespace DTS.Common.RibbonControl
{
public class ToggleButtonData : ControlData
{
public bool IsChecked
{
get => _isChecked;
set
{
if (_isChecked == value) return;
_isChecked = value;
OnPropertyChanged(new PropertyChangedEventArgs("IsChecked"));
}
}
private bool _isChecked;
}
}

View File

@@ -0,0 +1,55 @@
using System;
using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;
namespace DTS.Common.RibbonControl
{
public static class ViewModelData
{
internal const int TabCount = 4;
internal const int ContextualTabGroupCount = 2;
internal const int GroupCount = 3;
internal const int ControlCount = 5;
internal const int ButtonCount = 1;
internal const int ToggleButtonCount = 1;
internal const int RadioButtonCount = 1;
internal const int CheckBoxCount = 1;
internal const int TextBoxCount = 1;
internal const int MenuButtonCount = 1;
internal const int MenuItemCount = 2;
internal const int SplitButtonCount = 1;
internal const int SplitMenuItemCount = 2;
internal const int GalleryCount = 1;
internal const int GalleryCategoryCount = 3;
internal const int GalleryItemCount = 10;
internal const int MenuItemNestingCount = 2;
internal const int ComboBoxCount = 1;
public static RibbonData RibbonData
{
get
{
if (_data == null)
{
_data = new RibbonData();
}
return _data;
}
}
public static ICommand DefaultCommand => _defaultCommand ?? (_defaultCommand = new DelegateCommand(DefaultExecuted, DefaultCanExecute));
private static void DefaultExecuted()
{
}
private static bool DefaultCanExecute()
{
return true;
}
[ThreadStatic]
private static RibbonData _data;
private static ICommand _defaultCommand;
}
}