1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- namespace FWindSoft.Wpf.Controls
- {
- public class LabelEditor: HeaderedContentControl
- {
- public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register("Orientation",
- typeof(Orientation),
- typeof(LabelEditor), new PropertyMetadata(Orientation.Horizontal));
- public static readonly DependencyProperty LabelWidthProperty = DependencyProperty.Register("LabelWidth",
- typeof(double),
- typeof(LabelEditor), new PropertyMetadata(0d));
- public static readonly DependencyProperty LabelHeightProperty = DependencyProperty.Register(" LabelHeight",
- typeof(double),
- typeof(LabelEditor), new PropertyMetadata(0d));
- public static readonly DependencyProperty LabelHorizontalAlignmentProperty = DependencyProperty.Register(" LabelHorizontalAlignment",
- typeof(HorizontalAlignment),
- typeof(LabelEditor), new PropertyMetadata(HorizontalAlignment.Right));
- static LabelEditor()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(LabelEditor),
- new FrameworkPropertyMetadata(typeof(LabelEditor)));
- }
- public LabelEditor()
- {
- this.HorizontalContentAlignment = HorizontalAlignment.Stretch;
- this.VerticalContentAlignment = VerticalAlignment.Stretch;
- }
- #region 依赖属性
- /// <summary>
- /// 关联显示属性集合
- /// </summary>
- public Orientation Orientation
- {
- get { return (Orientation)GetValue(OrientationProperty); }
- set { SetValue(OrientationProperty, value); }
- }
- /// <summary>
- /// 标签宽度
- /// </summary>
- public Double LabelWidth
- {
- get { return (double)GetValue(LabelWidthProperty); }
- set { SetValue(LabelWidthProperty, value); }
- }
- /// <summary>
- /// 变迁高度
- /// </summary>
- public Double LabelHeight
- {
- get { return (double)GetValue(LabelHeightProperty); }
- set { SetValue(LabelHeightProperty, value); }
- }
- public HorizontalAlignment LabelHorizontalAlignment
- {
- get { return (HorizontalAlignment)GetValue(LabelHorizontalAlignmentProperty); }
- set { SetValue(LabelHorizontalAlignmentProperty, value); }
- }
- #endregion
- }
-
- }
|