You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

  1. using System.Windows;
  2. namespace BPA.UIControl
  3. {
  4. /// <summary>
  5. /// Menu 帮助类
  6. /// </summary>
  7. public class MenuHelper
  8. {
  9. /// <summary>
  10. /// 图标宽度
  11. /// </summary>
  12. public static readonly DependencyProperty IconWidthProperty = DependencyProperty.RegisterAttached(
  13. "IconWidth", typeof(double), typeof(MenuHelper), new PropertyMetadata(default(double)));
  14. /// <summary>
  15. /// Sets the IconWidth.
  16. /// </summary>
  17. /// <param name="element">The element.</param>
  18. /// <param name="value">If true, value.</param>
  19. public static void SetIconWidth(DependencyObject element, double value)
  20. {
  21. element.SetValue(IconWidthProperty, value);
  22. }
  23. /// <summary>
  24. /// Gets the IconWidth.
  25. /// </summary>
  26. /// <param name="element">The element.</param>
  27. /// <returns>A bool.</returns>
  28. public static double GetShowShadow(DependencyObject element)
  29. {
  30. return (double)element.GetValue(IconWidthProperty);
  31. }
  32. }
  33. }