LayoutGridResizerControl.cs 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*************************************************************************************
  2. Extended WPF Toolkit
  3. Copyright (C) 2007-2013 Xceed Software Inc.
  4. This program is provided to you under the terms of the Microsoft Public
  5. License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
  6. For more features, controls, and fast professional support,
  7. pick up the Plus Edition at http://xceed.com/wpf_toolkit
  8. Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
  9. ***********************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Windows.Controls.Primitives;
  15. using System.Windows;
  16. using System.Windows.Media;
  17. namespace Xceed.Wpf.AvalonDock.Controls
  18. {
  19. public class LayoutGridResizerControl : Thumb
  20. {
  21. static LayoutGridResizerControl()
  22. {
  23. //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
  24. //This style is defined in themes\generic.xaml
  25. DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutGridResizerControl), new FrameworkPropertyMetadata(typeof(LayoutGridResizerControl)));
  26. HorizontalAlignmentProperty.OverrideMetadata(typeof(LayoutGridResizerControl), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
  27. VerticalAlignmentProperty.OverrideMetadata(typeof(LayoutGridResizerControl), new FrameworkPropertyMetadata(VerticalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
  28. BackgroundProperty.OverrideMetadata(typeof(LayoutGridResizerControl), new FrameworkPropertyMetadata(Brushes.Transparent));
  29. IsHitTestVisibleProperty.OverrideMetadata(typeof(LayoutGridResizerControl), new FrameworkPropertyMetadata(true, null));
  30. }
  31. #region BackgroundWhileDragging
  32. /// <summary>
  33. /// BackgroundWhileDragging Dependency Property
  34. /// </summary>
  35. public static readonly DependencyProperty BackgroundWhileDraggingProperty =
  36. DependencyProperty.Register("BackgroundWhileDragging", typeof(Brush), typeof(LayoutGridResizerControl),
  37. new FrameworkPropertyMetadata((Brush)Brushes.Black));
  38. /// <summary>
  39. /// Gets or sets the BackgroundWhileDragging property. This dependency property
  40. /// indicates ....
  41. /// </summary>
  42. public Brush BackgroundWhileDragging
  43. {
  44. get { return (Brush)GetValue(BackgroundWhileDraggingProperty); }
  45. set { SetValue(BackgroundWhileDraggingProperty, value); }
  46. }
  47. #endregion
  48. #region OpacityWhileDragging
  49. /// <summary>
  50. /// OpacityWhileDragging Dependency Property
  51. /// </summary>
  52. public static readonly DependencyProperty OpacityWhileDraggingProperty =
  53. DependencyProperty.Register("OpacityWhileDragging", typeof(double), typeof(LayoutGridResizerControl),
  54. new FrameworkPropertyMetadata((double)0.5));
  55. /// <summary>
  56. /// Gets or sets the OpacityWhileDragging property. This dependency property
  57. /// indicates ....
  58. /// </summary>
  59. public double OpacityWhileDragging
  60. {
  61. get { return (double)GetValue(OpacityWhileDraggingProperty); }
  62. set { SetValue(OpacityWhileDraggingProperty, value); }
  63. }
  64. #endregion
  65. }
  66. }