DropArea.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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;
  15. namespace Xceed.Wpf.AvalonDock.Controls
  16. {
  17. public enum DropAreaType
  18. {
  19. DockingManager,
  20. DocumentPane,
  21. DocumentPaneGroup,
  22. AnchorablePane,
  23. }
  24. public interface IDropArea
  25. {
  26. Rect DetectionRect { get; }
  27. DropAreaType Type { get; }
  28. }
  29. public class DropArea<T> : IDropArea where T : FrameworkElement
  30. {
  31. internal DropArea(T areaElement, DropAreaType type)
  32. {
  33. _element = areaElement;
  34. _detectionRect = areaElement.GetScreenArea();
  35. _type = type;
  36. }
  37. Rect _detectionRect;
  38. public Rect DetectionRect
  39. {
  40. get { return _detectionRect; }
  41. }
  42. DropAreaType _type;
  43. public DropAreaType Type
  44. {
  45. get { return _type; }
  46. }
  47. T _element;
  48. public T AreaElement
  49. {
  50. get
  51. {
  52. return _element;
  53. }
  54. }
  55. }
  56. }