using System.ComponentModel; using System.Windows; using System.Windows.Media; namespace CustomControls { [DesignTimeVisible(false)] public partial class ToolStripLabel : System.Windows.Controls.UserControl { public string Text { get { return (string)GetValue(TextProperty); } set { SetValue(TextProperty, value); } } public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(ToolStripLabel), new PropertyMetadata("")); public ImageSource Image { get { return (ImageSource)GetValue(ImageProperty); } set { SetValue(ImageProperty, value); } } public static readonly DependencyProperty ImageProperty = DependencyProperty.Register("Image", typeof(ImageSource), typeof(ToolStripLabel), new PropertyMetadata(null)); public ToolStripLabel() { InitializeComponent(); } } }