diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-20 20:33:05 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-20 20:33:05 -0500 |
| commit | 767cdc1f6f6a63ce997fc9476911e2c361f9d402 (patch) | |
| tree | 49add55976f895441167c66cfa95e5c7688d18ce /MediaBrowser.UI/Controls/NotificationMessage.xaml.cs | |
| parent | 845554722efaed872948a9e0f7202e3ef52f1b6e (diff) | |
Pushing missing changes
Diffstat (limited to 'MediaBrowser.UI/Controls/NotificationMessage.xaml.cs')
| -rw-r--r-- | MediaBrowser.UI/Controls/NotificationMessage.xaml.cs | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/MediaBrowser.UI/Controls/NotificationMessage.xaml.cs b/MediaBrowser.UI/Controls/NotificationMessage.xaml.cs new file mode 100644 index 000000000..06ed513b1 --- /dev/null +++ b/MediaBrowser.UI/Controls/NotificationMessage.xaml.cs @@ -0,0 +1,68 @@ +using System; +using System.Windows; +using System.Windows.Controls; + +namespace MediaBrowser.UI.Controls +{ + /// <summary> + /// Interaction logic for NotificationMessage.xaml + /// </summary> + public partial class NotificationMessage : BaseUserControl + { + public NotificationMessage() + { + InitializeComponent(); + } + + public UIElement TextContent + { + set + { + pnlContent.Children.Clear(); + + var textBlock = value as TextBlock; + + if (textBlock != null) + { + textBlock.SetResourceReference(TextBlock.StyleProperty, "NotificationTextStyle"); + } + pnlContent.Children.Add(value); + } + } + + public string Text + { + set { TextContent = new TextBlock { Text = value }; } + } + + private MessageBoxIcon _messageBoxImage; + public MessageBoxIcon MessageBoxImage + { + get { return _messageBoxImage; } + set + { + _messageBoxImage = value; + OnPropertyChanged("MessageBoxImage"); + } + } + + private string _caption; + public string Caption + { + get { return _caption; } + set + { + _caption = value; + OnPropertyChanged("Caption"); + txtCaption.Visibility = string.IsNullOrEmpty(value) ? Visibility.Collapsed : Visibility.Visible; + } + } + + protected override void OnInitialized(EventArgs e) + { + base.OnInitialized(e); + + DataContext = this; + } + } +} |
