cdca6e492b5bc1845126329ee7e54f80c4d5c8ab
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / DockedAnnotationDecorator.cs
1 //----------------------------------------------------------------
2 // <copyright company="Microsoft Corporation">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //----------------------------------------------------------------
6
7 namespace System.Activities.Presentation
8 {
9     using System.Windows;
10     using System.Windows.Controls;
11
12     internal class DockedAnnotationDecorator : Decorator
13     {
14         protected override Size MeasureOverride(Size availableSize)
15         {
16             Size size = new Size();
17
18             if (this.Child != null)
19             {
20                 this.Child.Measure(availableSize);
21                 size.Height = this.Child.DesiredSize.Height;
22             }
23
24             return size;
25         }
26
27         protected override Size ArrangeOverride(Size finalSize)
28         {
29             if (this.Child != null)
30             {
31                 this.Child.Arrange(new Rect(finalSize));
32             }
33
34             return finalSize;
35         }
36     }
37 }