CPDFRotationControl.xaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <UserControl x:Class="ComPDFKit.Controls.Common.CPDFRotationControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:ComPDFKit.Controls.Common"
  7. mc:Ignorable="d"
  8. d:DesignHeight="32" d:DesignWidth="186">
  9. <UserControl.Resources>
  10. <Style x:Key="TransparentButtonStyle" TargetType="{x:Type Button}">
  11. <Setter Property="BorderThickness" Value="0" />
  12. <Setter Property="Height" Value="32"></Setter>
  13. <Setter Property="Width" Value="32"></Setter>
  14. <Setter Property="Template">
  15. <Setter.Value>
  16. <ControlTemplate TargetType="Button">
  17. <Border Name="border" Background="Transparent">
  18. <ContentPresenter />
  19. </Border>
  20. <ControlTemplate.Triggers>
  21. <Trigger Property="IsMouseOver" Value="True">
  22. <Setter TargetName="border" Property="Background" Value="#1a000000" />
  23. </Trigger>
  24. <Trigger Property="IsPressed" Value="True">
  25. <Setter TargetName="border" Property="Background" Value="#5a000000" />
  26. </Trigger>
  27. </ControlTemplate.Triggers>
  28. </ControlTemplate>
  29. </Setter.Value>
  30. </Setter>
  31. </Style>
  32. </UserControl.Resources>
  33. <Grid HorizontalAlignment="Left">
  34. <Grid.ColumnDefinitions>
  35. <ColumnDefinition Width="auto"></ColumnDefinition>
  36. <ColumnDefinition Width="auto"></ColumnDefinition>
  37. </Grid.ColumnDefinitions>
  38. <local:NumericUpDownControl x:Name="NumericUpDownControl" Width="82" Minimum="-360" Maximum="360" Text="{Binding RotationText, Mode=TwoWay}"></local:NumericUpDownControl>
  39. <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="8,0,0,0">
  40. <Button x:Name="CounterclockwiseBtn" Style="{StaticResource TransparentButtonStyle}" Click="RotationBtn_Click">
  41. <Path HorizontalAlignment="Center" VerticalAlignment="Center" Data="M14.5,0H1.5V16H14.5V0ZM13.5,1V15H2.5V1H13.5ZM6.58579,3.75736L3.75736,6.58579L9.41421,12.2426L12.2426,9.41421L6.58579,3.75736Z" Fill="#001A4E" />
  42. </Button>
  43. <Button x:Name="ResetBtn" Style="{StaticResource TransparentButtonStyle}" Click="RotationBtn_Click">
  44. <Path HorizontalAlignment="Center" VerticalAlignment="Center" Data="M14.5 0H1.5V16H14.5V0ZM13.5 1V15H2.5V1H13.5ZM10 4H6V12H10V4Z" Fill="#001A4E" />
  45. </Button>
  46. <Button x:Name="ClockwiseBtn" Style="{StaticResource TransparentButtonStyle}" Click="RotationBtn_Click">
  47. <Path HorizontalAlignment="Center" VerticalAlignment="Center" Data="M14.5 0H1.5V16H14.5V0ZM13.5 1V15H2.5V1H13.5ZM12.2426 6.58579L9.41421 3.75736L3.75736 9.41421L6.58579 12.2426L12.2426 6.58579Z" Fill="#001A4E" />
  48. </Button>
  49. </StackPanel>
  50. </Grid>
  51. </UserControl>