TextboxWithLabel.xaml.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace Venus_Themes.UserControls
  16. {
  17. /// <summary>
  18. /// TextboxWithLabel.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class TextboxWithLabel : UserControl
  21. {
  22. public TextboxWithLabel()
  23. {
  24. InitializeComponent();
  25. }
  26. public static readonly DependencyProperty LabelValueProperty = DependencyProperty.Register(
  27. "LabelValue", typeof(string), typeof(TextboxWithLabel));
  28. public string LabelValue
  29. {
  30. get { return (string)this.GetValue(LabelValueProperty); }
  31. set { this.SetValue(LabelValueProperty, value); }
  32. }
  33. public static readonly DependencyProperty TextBoxValueProperty = DependencyProperty.Register(
  34. "TextBoxValue", typeof(string), typeof(TextboxWithLabel));
  35. public string TextBoxValue
  36. {
  37. get { return (string)this.GetValue(TextBoxValueProperty); }
  38. set { this.SetValue(TextBoxValueProperty, value); }
  39. }
  40. public static readonly DependencyProperty TextBoxColorProperty = DependencyProperty.Register(
  41. "TextBoxColor", typeof(SolidColorBrush), typeof(TextboxWithLabel));
  42. public SolidColorBrush TextBoxColor
  43. {
  44. get { return (SolidColorBrush)this.GetValue(TextBoxColorProperty); }
  45. set { this.SetValue(LabelValueProperty, value); }
  46. }
  47. public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register(
  48. "IsReadOnly", typeof(bool), typeof(TextboxWithLabel),new PropertyMetadata (true));
  49. public bool IsReadOnly
  50. {
  51. get
  52. {
  53. return (bool)this.GetValue(IsReadOnlyProperty);
  54. }
  55. set
  56. {
  57. this.SetValue(IsReadOnlyProperty, value);
  58. }
  59. }
  60. }
  61. }