AnchorSideToAngleConverter.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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.Data;
  15. using Xceed.Wpf.AvalonDock.Layout;
  16. namespace Xceed.Wpf.AvalonDock.Converters
  17. {
  18. [ValueConversion(typeof(AnchorSide), typeof(double))]
  19. public class AnchorSideToAngleConverter : IValueConverter
  20. {
  21. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  22. {
  23. AnchorSide side = (AnchorSide)value;
  24. if (side == AnchorSide.Left ||
  25. side == AnchorSide.Right)
  26. return 90.0;
  27. return Binding.DoNothing;
  28. }
  29. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  30. {
  31. throw new NotImplementedException();
  32. }
  33. }
  34. }