Mercurial > silverbladetech
view Chronosv2/source/Presentation/Controls/Adorner/TextBlockAdorner.cs @ 27:96fdf58e05b4
Server working with sockets and rabbitmq
author | adminsh@apollo |
---|---|
date | Wed, 21 Mar 2012 19:00:59 +0000 |
parents | 443821e55f06 |
children |
line wrap: on
line source
using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace Chronos.Presentation.Controls.Adorner { public sealed class TextBlockAdorner : System.Windows.Documents.Adorner { #region · Fields · private readonly TextBlock adornerTextBlock; #endregion #region · Properties · protected override int VisualChildrenCount { get { return 1; } } #endregion #region · Constructors · public TextBlockAdorner(UIElement adornedElement, string label, Style labelStyle) : base(adornedElement) { this.adornerTextBlock = new TextBlock { Style = labelStyle, Text = label }; } #endregion #region · Overriden Methods · protected override Size MeasureOverride(Size constraint) { this.adornerTextBlock.Measure(constraint); return constraint; } protected override Size ArrangeOverride(Size finalSize) { this.adornerTextBlock.Arrange(new Rect(finalSize)); return finalSize; } protected override Visual GetVisualChild(int index) { return this.adornerTextBlock; } #endregion } }