markus / KCOM / Controls / AdornerFinal.xaml @ a0bab669
이력 | 보기 | 이력해설 | 다운로드 (11.4 KB)
1 |
<UserControl x:Class="KCOM.Controls.AdornerFinal" |
---|---|
2 |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
5 |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" |
6 |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
7 |
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" |
8 |
mc:Ignorable="d" xmlns:behavior="clr-namespace:KCOM.Common" |
9 |
d:DesignHeight="300" d:DesignWidth="400"> |
10 |
<Canvas x:Name="LayoutRoot"> |
11 |
<Canvas.Resources>
|
12 |
<Style TargetType="Thumb" x:Key="ThumbMoveStyle"> |
13 |
<!--<Setter Property="Margin" Value="10" />-->
|
14 |
<Setter Property="Template"> |
15 |
<Setter.Value>
|
16 |
<ControlTemplate TargetType="Thumb"> |
17 |
<Grid > |
18 |
<Rectangle x:Name="RectThumb" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Fill="#ffcfcfce" |
19 |
Opacity="0.6" Stroke="#ff6a6b68" StrokeDashArray="2 2" MouseLeftButtonDown="RectThumb_MouseLeftButtonDown"> |
20 |
</Rectangle>
|
21 |
<telerik:RadDropDownButton DropDownIndicatorVisibility="Collapsed" IsHitTestVisible="False" x:Name="Date_Drop" Opacity="0.01" |
22 |
Loaded="RadDropDownButton_Loaded" VerticalAlignment="Bottom" |
23 |
Width="{Binding ElementName=RectThumb, Path=Width}" Height="{Binding ElementName=RectThumb, Path=Height}"> |
24 |
<telerik:RadDropDownButton.DropDownContent>
|
25 |
<telerik:RadCalendar x:Name="Date_Calendar" Width="{Binding ElementName=RectThumb, Path=Width}" |
26 |
MinHeight="300" MinWidth="300" telerik:StyleManager.Theme="Windows8" |
27 |
Height="{Binding ElementName=RectThumb, Path=Height}" Loaded="Date_Calendar_Loaded"/> |
28 |
</telerik:RadDropDownButton.DropDownContent>
|
29 |
</telerik:RadDropDownButton>
|
30 |
</Grid>
|
31 |
</ControlTemplate>
|
32 |
</Setter.Value>
|
33 |
</Setter>
|
34 |
</Style>
|
35 |
<Style TargetType="Thumb" x:Key="ThumbTextStyle"> |
36 |
<Setter Property="Width" Value="20" /> |
37 |
<Setter Property="Opacity" Value="0.7" /> |
38 |
<Setter Property="Height" Value="20" /> |
39 |
<Setter Property="Template"> |
40 |
<Setter.Value>
|
41 |
<ControlTemplate TargetType="Thumb"> |
42 |
<!--<TextBox Text="" x:Name="testText" Loaded="testText_Loaded" Width="{Binding Width, ElementName=Self}" Height="{Binding Height, ElementName=Self}"/>-->
|
43 |
<Rectangle Fill="#ff8ef814" Width="{Binding Width, ElementName=Self}" Height="{Binding Height, ElementName=Self}" |
44 |
Opacity="0.6" MouseLeftButtonDown="RectThumb_MouseLeftButtonDown"/> |
45 |
</ControlTemplate>
|
46 |
</Setter.Value>
|
47 |
</Setter>
|
48 |
</Style>
|
49 |
<Style TargetType="Thumb" x:Key="ThumbResizeStyle"> |
50 |
<!--<Setter Property="Cursor" Value="None" />-->
|
51 |
<Setter Property="Margin" Value="-10" /> |
52 |
<Setter Property="Width" Value="20" /> |
53 |
<Setter Property="Cursor" Value="Hand"/> |
54 |
<Setter Property="Opacity" Value="1" /> |
55 |
<Setter Property="Height" Value="20" /> |
56 |
<Setter Property="Template"> |
57 |
<Setter.Value>
|
58 |
<ControlTemplate TargetType="Thumb"> |
59 |
<Ellipse Stroke="#ff2e3436" StrokeThickness="2" |
60 |
HorizontalAlignment="Center" Width="16" Height="16" Margin="0,0,0,0" Canvas.ZIndex="1"> |
61 |
<Ellipse.Fill>
|
62 |
<SolidColorBrush Color="#ff8ef814" Opacity="0.6"/> |
63 |
</Ellipse.Fill>
|
64 |
<i:Interaction.Behaviors>
|
65 |
<behavior:ExpandingMouseOver ScaleFactor="2"/> |
66 |
</i:Interaction.Behaviors>
|
67 |
</Ellipse>
|
68 |
</ControlTemplate>
|
69 |
</Setter.Value>
|
70 |
</Setter>
|
71 |
|
72 |
</Style>
|
73 |
<Style TargetType="Thumb" x:Key="ThumbArcControlStyle"> |
74 |
<!--<Setter Property="Cursor" Value="None" />-->
|
75 |
<Setter Property="Margin" Value="-10" /> |
76 |
<Setter Property="Width" Value="20" /> |
77 |
<Setter Property="Opacity" Value="1" /> |
78 |
<Setter Property="Cursor" Value="Hand"/> |
79 |
<Setter Property="Height" Value="20" /> |
80 |
<Setter Property="Template"> |
81 |
<Setter.Value>
|
82 |
<ControlTemplate TargetType="Thumb"> |
83 |
<Ellipse Stroke="#ff2e3436" StrokeThickness="2" MouseLeftButtonDown="ControlPointMouseLeftButtonDown" |
84 |
HorizontalAlignment="Center" Width="20" Height="20" Margin="0,0,0,0" Canvas.ZIndex="1"> |
85 |
<Ellipse.Fill>
|
86 |
<SolidColorBrush Color="#fff814df" Opacity="0.6"/> |
87 |
</Ellipse.Fill>
|
88 |
<i:Interaction.Behaviors>
|
89 |
<behavior:ExpandingMouseOver ScaleFactor="2"/> |
90 |
</i:Interaction.Behaviors>
|
91 |
</Ellipse>
|
92 |
</ControlTemplate>
|
93 |
</Setter.Value>
|
94 |
</Setter>
|
95 |
</Style>
|
96 |
<Style TargetType="Thumb" x:Key="ThumbResizeNoEdgeStyle"> |
97 |
<!--<Setter Property="Cursor" Value="None" />-->
|
98 |
<Setter Property="Width" Value="15" /> |
99 |
<Setter Property="Opacity" Value="0.7" /> |
100 |
<Setter Property="Height" Value="15" /> |
101 |
<Setter Property="Template"> |
102 |
<Setter.Value>
|
103 |
<ControlTemplate TargetType="Thumb"> |
104 |
<Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="Black" Background="#FF312C2C" BorderThickness="1"> |
105 |
<Rectangle Fill="#ae8237f3"/> |
106 |
</Border>
|
107 |
</ControlTemplate>
|
108 |
</Setter.Value>
|
109 |
</Setter>
|
110 |
</Style>
|
111 |
<Style TargetType="Thumb" x:Key="ThumbRotateStyle"> |
112 |
<!--<Setter Property="Cursor" Value="None" />-->
|
113 |
<Setter Property="Margin" Value="-15" /> |
114 |
<Setter Property="Width" Value="30" /> |
115 |
<Setter Property="Height" Value="30" /> |
116 |
<Setter Property="Template"> |
117 |
<Setter.Value>
|
118 |
<ControlTemplate TargetType="Thumb"> |
119 |
<Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="Black" Background="#FF312C2C" BorderThickness="1"> |
120 |
<Rectangle Fill="#FF07B4FF"> |
121 |
<i:Interaction.Behaviors>
|
122 |
<behavior:ExpandingMouseOver ScaleFactor="2"/> |
123 |
</i:Interaction.Behaviors>
|
124 |
</Rectangle>
|
125 |
</Border>
|
126 |
</ControlTemplate>
|
127 |
</Setter.Value>
|
128 |
</Setter>
|
129 |
</Style>
|
130 |
<Style TargetType="Thumb" x:Key="ThumbSingleRotateStyle"> |
131 |
<!--<Setter Property="Cursor" Value="None" />-->
|
132 |
<Setter Property="Margin" Value="-15" /> |
133 |
<Setter Property="Width" Value="20" /> |
134 |
<Setter Property="Height" Value="30" /> |
135 |
<Setter Property="Template"> |
136 |
<Setter.Value>
|
137 |
<ControlTemplate TargetType="Thumb"> |
138 |
<!--</Border>-->
|
139 |
<!--<Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="Black" Background="#FF312C2C" BorderThickness="1">-->
|
140 |
<StackPanel x:Name="RotateThumb"> |
141 |
<Ellipse Stroke="#ff2e3436" Fill="#ff18b7fc" StrokeThickness="2" |
142 |
HorizontalAlignment="Center" Width="16" Height="15" Margin="0,5,0,0" Canvas.ZIndex="99"> |
143 |
<i:Interaction.Behaviors>
|
144 |
<behavior:ExpandingMouseOver ScaleFactor="1.5"/> |
145 |
</i:Interaction.Behaviors>
|
146 |
</Ellipse>
|
147 |
<Rectangle Fill="#ff2e3436" Width="2" Height="40" HorizontalAlignment="Center" Canvas.ZIndex="99"/> |
148 |
</StackPanel>
|
149 |
</ControlTemplate>
|
150 |
</Setter.Value>
|
151 |
</Setter>
|
152 |
</Style>
|
153 |
</Canvas.Resources>
|
154 |
<Canvas x:Name="ContainerContent" Background="Transparent" Canvas.ZIndex="82"> |
155 |
<Thumb x:Name="DragThumb" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="1" Opacity="1" |
156 |
DragStarted="drag_DragStarted" DragCompleted="drag_DragCompleted" Loaded="DragThumb_Loaded" MouseDoubleClick="DragThumb_MouseDoubleClick" |
157 |
DragDelta="DragThumb_DragDelta" Canvas.ZIndex="81" Style="{StaticResource ThumbMoveStyle}" RenderTransformOrigin="0.5,0.5"> |
158 |
<Thumb.RenderTransform>
|
159 |
<TransformGroup>
|
160 |
<!--<CompositeTransform x:Name="trRotate"/>-->
|
161 |
<RotateTransform x:Name="trRotateThumb"/> |
162 |
</TransformGroup>
|
163 |
</Thumb.RenderTransform>
|
164 |
</Thumb>
|
165 |
</Canvas>
|
166 |
<Grid x:Name="AdornerBorder" Background="Transparent" RenderTransformOrigin="0.5,0.5" Canvas.ZIndex="80"> |
167 |
<Grid.RowDefinitions>
|
168 |
<RowDefinition Height="0"/> |
169 |
<RowDefinition/> |
170 |
<RowDefinition Height="0"/> |
171 |
</Grid.RowDefinitions>
|
172 |
<Grid.ColumnDefinitions>
|
173 |
<ColumnDefinition Width="0"/> |
174 |
<ColumnDefinition/> |
175 |
<ColumnDefinition Width="0"/> |
176 |
</Grid.ColumnDefinitions>
|
177 |
<Grid.RenderTransform>
|
178 |
<RotateTransform x:Name="trRotate"/> |
179 |
</Grid.RenderTransform>
|
180 |
<Thumb x:Name="rotateTop" Style="{StaticResource ThumbSingleRotateStyle}" Grid.Column="1" HorizontalAlignment="Stretch" |
181 |
VerticalAlignment="Top" Margin="0,-30" Grid.ColumnSpan="3" Grid.RowSpan="3" Canvas.ZIndex="99" |
182 |
Width="30" Height="30" DragStarted="rotate_DragStarted" MouseMove="rotate_MouseMove" DragDelta="rotate_DragDelta" |
183 |
DragCompleted="rotate_DragCompleted"> |
184 |
</Thumb>
|
185 |
</Grid>
|
186 |
</Canvas>
|
187 |
</UserControl>
|