|
8 | 8 | Height="{Binding WindowHeight, Mode=TwoWay}" |
9 | 9 | Topmost="True" |
10 | 10 | WindowStyle="None" |
11 | | - ResizeMode="CanResizeWithGrip" |
| 11 | + ResizeMode="CanResize" |
12 | 12 | AllowsTransparency="True" |
13 | 13 | MinWidth="150" |
14 | 14 | MinHeight="50" |
15 | 15 | WindowStartupLocation="CenterScreen" |
16 | 16 | Background="Transparent" |
17 | 17 | Loaded="Window_Loaded" |
18 | 18 | Closing="Window_Closing"> |
19 | | - |
| 19 | + |
20 | 20 | <Window.Resources> |
21 | 21 | <ResourceDictionary> |
22 | 22 | <ResourceDictionary.MergedDictionaries> |
|
47 | 47 | <Setter Property="Stroke" Value="Black" /> |
48 | 48 | <Setter Property="Fill" Value="Black" /> |
49 | 49 | </Style> |
| 50 | + <Style x:Key="RectBorderStyle" TargetType="Rectangle"> |
| 51 | + <Setter Property="Focusable" Value="False" /> |
| 52 | + <Setter Property="Fill" Value="White" /> |
| 53 | + <Setter Property="Opacity" Value="0.5" /> |
| 54 | + <Setter Property="Stroke" Value="Magenta" /> |
| 55 | + <Setter Property="Tag" Value="{Binding RelativeSource={RelativeSource AncestorType=Window}}" /> |
| 56 | + <EventSetter Event="MouseLeftButtonDown" Handler="ResizeInit"/> |
| 57 | + <EventSetter Event="MouseLeftButtonUp" Handler="ResizeEnd"/> |
| 58 | + <EventSetter Event="MouseMove" Handler="ResizingForm"/> |
| 59 | + </Style> |
50 | 60 | </Grid.Resources> |
51 | 61 |
|
52 | 62 | <StackPanel Orientation="Horizontal" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> |
53 | 63 | <Button Name="btnMenu" Click="btnMenu_Click" |
54 | 64 | ToolTip="Select grid type"> |
55 | 65 | <ContentControl> |
56 | 66 | <Path Data="{Binding Source={StaticResource pathDataRow}}" /> |
57 | | - </ContentControl> |
| 67 | + </ContentControl> |
58 | 68 | </Button> |
59 | 69 | <Button ToolTip="Snap to image borders in topmost window" |
60 | 70 | Command="{Binding SnapCommand}"> |
|
66 | 76 | Command="{Binding RotateCounterClockwiseCommand}"> |
67 | 77 | <ContentControl> |
68 | 78 | <Path Data="{Binding Source={StaticResource pathDataRotate01}}" /> |
69 | | - </ContentControl> |
| 79 | + </ContentControl> |
70 | 80 | </Button> |
71 | 81 | <Button ToolTip="Rotate grid clockwise" |
72 | 82 | Command="{Binding RotateClockwiseCommand}"> |
|
100 | 110 | ToolTip="Grid lines color" |
101 | 111 | ItemsSource="{Binding LineColors, Mode=OneTime}" |
102 | 112 | SelectedItem="{Binding SelectedLineColor, Mode=TwoWay}"> |
103 | | - <ComboBox.ItemTemplate> |
| 113 | + <ComboBox.ItemTemplate> |
104 | 114 | <DataTemplate> |
105 | 115 | <StackPanel Orientation="Horizontal" Margin="2"> |
106 | 116 | <Rectangle Stroke="Black" |
|
142 | 152 | HorizontalAlignment="Stretch" VerticalAlignment="Stretch" |
143 | 153 | Content="{Binding ContentControl}" /> |
144 | 154 |
|
| 155 | + <Rectangle x:Name="LeftSizeGrip" Grid.Row="2" |
| 156 | + Width="3" Height="50" |
| 157 | + HorizontalAlignment="Left" VerticalAlignment="Center" |
| 158 | + Cursor="SizeWE" |
| 159 | + Style="{StaticResource RectBorderStyle}" /> |
| 160 | + |
| 161 | + <Rectangle x:Name="RightSizeGrip" Grid.Row="2" |
| 162 | + Width="3" Height="50" |
| 163 | + HorizontalAlignment="Right" VerticalAlignment="Center" |
| 164 | + Cursor="SizeWE" |
| 165 | + Style="{StaticResource RectBorderStyle}" /> |
| 166 | + |
| 167 | + <Rectangle x:Name="BottomSizeGrip" Grid.Row="2" |
| 168 | + Width="50" Height="3" |
| 169 | + HorizontalAlignment="Center" VerticalAlignment="Bottom" |
| 170 | + Cursor="SizeNS" |
| 171 | + Style="{StaticResource RectBorderStyle}" /> |
| 172 | + |
| 173 | + <Rectangle Name="BottomRightSizeGrip" Grid.Row="2" |
| 174 | + Width="5" Height="5" |
| 175 | + HorizontalAlignment="Right" VerticalAlignment="Bottom" |
| 176 | + Cursor="SizeNWSE" |
| 177 | + Style="{StaticResource RectBorderStyle}" /> |
| 178 | + |
| 179 | + <Rectangle Name="BottomLeftSizeGrip" Grid.Row="2" |
| 180 | + Width="5" Height="5" |
| 181 | + HorizontalAlignment="Left" VerticalAlignment="Bottom" |
| 182 | + Cursor="SizeNESW" |
| 183 | + Style="{StaticResource RectBorderStyle}" /> |
| 184 | + |
| 185 | + <Rectangle Name="TopLeftSizeGrip" Grid.Row="2" |
| 186 | + Width="5" Height="5" |
| 187 | + HorizontalAlignment="Left" VerticalAlignment="Top" |
| 188 | + Cursor="SizeNWSE" |
| 189 | + Style="{StaticResource RectBorderStyle}" /> |
| 190 | + |
| 191 | + <Rectangle Name="TopRightSizeGrip" Grid.Row="2" |
| 192 | + Width="5" Height="5" |
| 193 | + HorizontalAlignment="Right" VerticalAlignment="Top" |
| 194 | + Cursor="SizeNESW" |
| 195 | + Style="{StaticResource RectBorderStyle}" /> |
| 196 | + |
145 | 197 | </Grid> |
146 | 198 | </Window> |
0 commit comments