-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTextBoxAttached.cs
30 lines (27 loc) · 1.06 KB
/
TextBoxAttached.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Windows;
using System.Windows.Controls;
namespace PPMusic
{
public class TextBoxAttached
{
public static readonly DependencyProperty WaterMarkIconProperty
= DependencyProperty.RegisterAttached(
"WaterMarkIcon",
typeof(object),
typeof(TextBoxAttached),
new UIPropertyMetadata(null)
);
[AttachedPropertyBrowsableForType(typeof(TextBox))]
public static void SetWaterMarkIcon(DependencyObject element,
object value
)
{
element.SetValue(WaterMarkIconProperty, value);
}
[AttachedPropertyBrowsableForType(typeof(TextBox))]
public static object GetWaterMarkIcon(DependencyObject element)
{
return element.GetValue(WaterMarkIconProperty);
}
}
}