[corlib] Update ValueTuple implementation
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Annotations / UIElementToAnnotationIndicatorAdapter.cs
1 //----------------------------------------------------------------
2 // <copyright company="Microsoft Corporation">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //----------------------------------------------------------------
6
7 namespace System.Activities.Presentation.Annotations
8 {
9     using System;
10     using System.ComponentModel;
11     using System.Windows;
12
13     internal class UIElementToAnnotationIndicatorAdapter : IAnnotationIndicator
14     {
15         private UIElement element;
16
17         public UIElementToAnnotationIndicatorAdapter(UIElement element)
18         {
19             if (element == null)
20             {
21                 throw FxTrace.Exception.AsError(new ArgumentNullException("element"));
22             }
23
24             this.element = element;
25         }
26
27         public event EventHandler IsMouseOverChanged
28         {
29             add
30             {
31                 DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(UIElement.IsMouseOverProperty, typeof(UIElement));
32                 descriptor.AddValueChanged(this.element, value);
33             }
34
35             remove
36             {
37                 DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(UIElement.IsMouseOverProperty, typeof(UIElement));
38                 descriptor.RemoveValueChanged(this.element, value);
39             }
40         }
41
42         public bool IsMouseOver
43         {
44             get
45             {
46                 return this.element.IsMouseOver;
47             }
48         }
49
50         public Visibility Visibility
51         {
52             set
53             {
54                 this.element.Visibility = value;
55             }
56         }
57     }
58 }