ToolStripLabel.xaml.cs 1020 B

123456789101112131415161718192021222324252627282930313233
  1. using System.ComponentModel;
  2. using System.Windows;
  3. using System.Windows.Media;
  4. namespace CustomControls
  5. {
  6. [DesignTimeVisible(false)]
  7. public partial class ToolStripLabel : System.Windows.Controls.UserControl
  8. {
  9. public string Text
  10. {
  11. get { return (string)GetValue(TextProperty); }
  12. set { SetValue(TextProperty, value); }
  13. }
  14. public static readonly DependencyProperty TextProperty =
  15. DependencyProperty.Register("Text", typeof(string), typeof(ToolStripLabel), new PropertyMetadata(""));
  16. public ImageSource Image
  17. {
  18. get { return (ImageSource)GetValue(ImageProperty); }
  19. set { SetValue(ImageProperty, value); }
  20. }
  21. public static readonly DependencyProperty ImageProperty =
  22. DependencyProperty.Register("Image", typeof(ImageSource), typeof(ToolStripLabel), new PropertyMetadata(null));
  23. public ToolStripLabel()
  24. {
  25. InitializeComponent();
  26. }
  27. }
  28. }