forked from github/VisualStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPromptTextBox.cs
More file actions
39 lines (34 loc) · 1.44 KB
/
PromptTextBox.cs
File metadata and controls
39 lines (34 loc) · 1.44 KB
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
31
32
33
34
35
36
37
38
39
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
namespace GitHub.UI
{
public class PromptTextBox : TextBox, IShortcutContainer
{
public static readonly DependencyProperty IconContentProperty =
DependencyProperty.RegisterAttached(nameof(IconContent), typeof(object), typeof(PromptTextBox));
public static readonly DependencyProperty IconContentTemplateProperty =
DependencyProperty.RegisterAttached(nameof(IconContentTemplate), typeof(DataTemplate), typeof(PromptTextBox));
public static readonly DependencyProperty PromptTextProperty =
DependencyProperty.Register(nameof(PromptText), typeof(string), typeof(PromptTextBox), new UIPropertyMetadata(""));
public object IconContent
{
get { return GetValue(IconContentProperty); }
set { SetValue(IconContentProperty, value); }
}
public object IconContentTemplate
{
get { return GetValue(IconContentTemplateProperty); }
set { SetValue(IconContentTemplateProperty, value); }
}
[Localizability(LocalizationCategory.Text)]
[DefaultValue("")]
public string PromptText
{
get { return (string)GetValue(PromptTextProperty); }
set { SetValue(PromptTextProperty, value); }
}
[DefaultValue(true)]
public bool SupportsKeyboardShortcuts { get; set; }
}
}