CustomIconToggleBtn.cs 916 B

1234567891011121314151617181920212223242526272829303132333435
  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.Controls.Primitives;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. namespace PDF_Office.CustomControl
  12. {
  13. public class CustomIconToggleBtn: ToggleButton
  14. {
  15. public CustomIconToggleBtn()
  16. {
  17. }
  18. public override void OnApplyTemplate()
  19. {
  20. base.OnApplyTemplate();
  21. }
  22. public ImageSource Icon
  23. {
  24. get { return (ImageSource)GetValue(NormalIconProperty); }
  25. set { SetValue(NormalIconProperty, value); }
  26. }
  27. public static readonly DependencyProperty NormalIconProperty =
  28. DependencyProperty.Register("Icon", typeof(ImageSource), typeof(CustomIconToggleBtn), new PropertyMetadata(null));
  29. }
  30. }