mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-27 19:53:24 +08:00
80 lines
2.6 KiB
C#
80 lines
2.6 KiB
C#
// ReSharper disable once CheckNamespace
|
|
namespace Fluent
|
|
{
|
|
using System.Collections.ObjectModel;
|
|
using System.ComponentModel;
|
|
using System.Windows;
|
|
using System.Windows.Markup;
|
|
|
|
/// <summary>
|
|
/// Represents size definition for group box
|
|
/// </summary>
|
|
[ContentProperty(nameof(Rows))]
|
|
public class RibbonToolBarLayoutDefinition : DependencyObject
|
|
{
|
|
#region Fields
|
|
|
|
// User defined rows
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
#region Size
|
|
|
|
/// <summary>
|
|
/// Gets or sets Size for the element.
|
|
/// </summary>
|
|
public RibbonControlSize Size
|
|
{
|
|
get { return (RibbonControlSize)this.GetValue(SizeProperty); }
|
|
set { this.SetValue(SizeProperty, value); }
|
|
}
|
|
|
|
/// <summary>Identifies the <see cref="Size"/> dependency property.</summary>
|
|
public static readonly DependencyProperty SizeProperty = RibbonProperties.SizeProperty.AddOwner(typeof(RibbonToolBarLayoutDefinition));
|
|
|
|
#endregion
|
|
|
|
#region SizeDefinition
|
|
|
|
/// <summary>
|
|
/// Gets or sets SizeDefinition for element.
|
|
/// </summary>
|
|
public RibbonControlSizeDefinition SizeDefinition
|
|
{
|
|
get { return (RibbonControlSizeDefinition)this.GetValue(SizeDefinitionProperty); }
|
|
set { this.SetValue(SizeDefinitionProperty, value); }
|
|
}
|
|
|
|
/// <summary>Identifies the <see cref="SizeDefinition"/> dependency property.</summary>
|
|
public static readonly DependencyProperty SizeDefinitionProperty = RibbonProperties.SizeDefinitionProperty.AddOwner(typeof(RibbonToolBarLayoutDefinition));
|
|
|
|
#endregion
|
|
|
|
#region Row Count
|
|
|
|
/// <summary>
|
|
/// Gets or sets count of rows in the ribbon toolbar
|
|
/// </summary>
|
|
public int RowCount
|
|
{
|
|
get { return (int)this.GetValue(RowCountProperty); }
|
|
set { this.SetValue(RowCountProperty, value); }
|
|
}
|
|
|
|
/// <summary>Identifies the <see cref="RowCount"/> dependency property.</summary>
|
|
public static readonly DependencyProperty RowCountProperty =
|
|
DependencyProperty.Register(nameof(RowCount), typeof(int), typeof(RibbonToolBarLayoutDefinition), new PropertyMetadata(3));
|
|
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// Gets rows
|
|
/// </summary>
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
public ObservableCollection<RibbonToolBarRow> Rows { get; } = new ObservableCollection<RibbonToolBarRow>();
|
|
|
|
#endregion
|
|
}
|
|
} |