ResizeablePopup.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using PixiEditor.Models.Enums;
  2. using System.Windows;
  3. namespace PixiEditor.Views
  4. {
  5. public class ResizeablePopup : Window
  6. {
  7. public static readonly DependencyProperty NewPercentageSizeProperty =
  8. DependencyProperty.Register(nameof(NewPercentageSize), typeof(int), typeof(ResizeablePopup), new PropertyMetadata(0));
  9. public static readonly DependencyProperty NewSelectedUnitProperty =
  10. DependencyProperty.Register(nameof(NewSelectedUnit), typeof(SizeUnit), typeof(SizePicker), new PropertyMetadata(SizeUnit.Pixel));
  11. // Using a DependencyProperty as the backing store for NewAbsoluteHeight. This enables animation, styling, binding, etc...
  12. public static readonly DependencyProperty NewAbsoluteHeightProperty =
  13. DependencyProperty.Register(nameof(NewAbsoluteHeight), typeof(int), typeof(ResizeablePopup), new PropertyMetadata(0));
  14. // Using a DependencyProperty as the backing store for NewAbsoluteWidth. This enables animation, styling, binding, etc...
  15. public static readonly DependencyProperty NewAbsoluteWidthProperty =
  16. DependencyProperty.Register(nameof(NewAbsoluteWidth), typeof(int), typeof(ResizeablePopup), new PropertyMetadata(0));
  17. public int NewPercentageSize
  18. {
  19. get => (int)GetValue(NewPercentageSizeProperty);
  20. set => SetValue(NewPercentageSizeProperty, value);
  21. }
  22. public SizeUnit NewSelectedUnit
  23. {
  24. get => (SizeUnit)GetValue(NewSelectedUnitProperty);
  25. set => SetValue(NewSelectedUnitProperty, value);
  26. }
  27. public int NewAbsoluteHeight
  28. {
  29. get => (int)GetValue(NewAbsoluteHeightProperty);
  30. set => SetValue(NewAbsoluteHeightProperty, value);
  31. }
  32. public int NewAbsoluteWidth
  33. {
  34. get => (int)GetValue(NewAbsoluteWidthProperty);
  35. set => SetValue(NewAbsoluteWidthProperty, value);
  36. }
  37. }
  38. }