using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BPA.UIControl
{
///
/// 描述控件子项
///
public class DescriptionItem : ContentControl
{
#region properties
///
/// 描述
///
public static readonly DependencyProperty DescriptionProperty =
DependencyProperty.Register("Description", typeof(object), typeof(DescriptionItem), new PropertyMetadata(default(object)));
///
/// 描述
///
public object Description
{
get { return (object)GetValue(DescriptionProperty); }
set { SetValue(DescriptionProperty, value); }
}
///
/// 描述列宽
///
public static readonly DependencyProperty DescriptionWidthProperty =
DependencyProperty.Register("DescriptionWidth", typeof(GridLength), typeof(DescriptionItem), new PropertyMetadata(GridLength.Auto));
///
/// 描述列宽
///
public GridLength DescriptionWidth
{
get { return (GridLength)GetValue(DescriptionWidthProperty); }
internal set { SetValue(DescriptionWidthProperty, value); }
}
///
/// 描述背景色
///
public static readonly DependencyProperty DescriptionBackgroundProperty =
DependencyProperty.Register("DescriptionBackground", typeof(Brush), typeof(DescriptionItem), new PropertyMetadata(default(Brush)));
///
/// 描述背景色
///
public Brush DescriptionBackground
{
get { return (Brush)GetValue(DescriptionBackgroundProperty); }
set { SetValue(DescriptionBackgroundProperty, value); }
}
///
/// 描述前景色
///
public static readonly DependencyProperty DescriptionForegroundProperty =
DependencyProperty.Register("DescriptionForeground", typeof(Brush), typeof(DescriptionItem), new PropertyMetadata(default(Brush)));
///
/// 描述前景色
///
public Brush DescriptionForeground
{
get { return (Brush)GetValue(DescriptionForegroundProperty); }
set { SetValue(DescriptionForegroundProperty, value); }
}
///
/// 描述字体大小
///
public static readonly DependencyProperty DescriptionFontSizeProperty =
DependencyProperty.Register("DescriptionFontSize", typeof(double), typeof(DescriptionItem), new FrameworkPropertyMetadata(SystemFonts.CaptionFontSize, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
///
/// 描述字体大小
///
public double DescriptionFontSize
{
get { return (double)GetValue(DescriptionFontSizeProperty); }
set { SetValue(DescriptionFontSizeProperty, value); }
}
///
/// 描述字体加粗
///
public static readonly DependencyProperty DescriptionFontWeightProperty =
DependencyProperty.Register("DescriptionFontWeight", typeof(FontWeight), typeof(DescriptionItem), new FrameworkPropertyMetadata(SystemFonts.CaptionFontWeight, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
///
/// 描述字体加粗
///
public FontWeight DescriptionFontWeight
{
get { return (FontWeight)GetValue(DescriptionFontWeightProperty); }
set { SetValue(DescriptionFontWeightProperty, value); }
}
///
/// 描述格边框厚度
///
public static readonly DependencyProperty DescriptionBorderThicknessProperty =
DependencyProperty.Register("DescriptionBorderThickness", typeof(Thickness), typeof(DescriptionItem), new FrameworkPropertyMetadata(default(Thickness), FrameworkPropertyMetadataOptions.AffectsParentMeasure));
///
/// 描述格边框厚度
///
public Thickness DescriptionBorderThickness
{
get { return (Thickness)GetValue(DescriptionBorderThicknessProperty); }
internal set { SetValue(DescriptionBorderThicknessProperty, value); }
}
///
/// 描述水平对齐
///
public static readonly DependencyProperty HorizontalDescriptionAlignmentProperty =
DependencyProperty.Register("HorizontalDescriptionAlignment", typeof(HorizontalAlignment), typeof(DescriptionItem), new FrameworkPropertyMetadata(default(HorizontalAlignment)));
///
/// 描述水平对齐
///
public HorizontalAlignment HorizontalDescriptionAlignment
{
get { return (HorizontalAlignment)GetValue(HorizontalDescriptionAlignmentProperty); }
set { SetValue(HorizontalDescriptionAlignmentProperty, value); }
}
///
/// 描述垂直对齐
///
public static readonly DependencyProperty VerticalDescriptionAlignmentProperty =
DependencyProperty.Register("VerticalDescriptionAlignment", typeof(VerticalAlignment), typeof(DescriptionItem), new FrameworkPropertyMetadata(default(VerticalAlignment)));
///
/// 描述垂直对齐
///
public VerticalAlignment VerticalDescriptionAlignment
{
get { return (VerticalAlignment)GetValue(VerticalDescriptionAlignmentProperty); }
set { SetValue(VerticalDescriptionAlignmentProperty, value); }
}
///
/// 内容格边框厚度
///
public static readonly DependencyProperty ContentBorderThicknessProperty =
DependencyProperty.Register("ContentBorderThickness", typeof(Thickness), typeof(DescriptionItem), new FrameworkPropertyMetadata(default(Thickness), FrameworkPropertyMetadataOptions.AffectsParentMeasure));
///
/// 内容格边框厚度
///
public Thickness ContentBorderThickness
{
get { return (Thickness)GetValue(ContentBorderThicknessProperty); }
internal set { SetValue(ContentBorderThicknessProperty, value); }
}
#endregion properties
static DescriptionItem()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(DescriptionItem), new FrameworkPropertyMetadata(typeof(DescriptionItem)));
}
}
}