프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Controls / AdornerFinal.xaml @ c7b02506

이력 | 보기 | 이력해설 | 다운로드 (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" 
6
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
7
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8
     xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
9
    mc:Ignorable="d"  xmlns:behavior="clr-namespace:KCOM.Common"
10
    d:DesignHeight="300" d:DesignWidth="400">
11
    <Canvas x:Name="LayoutRoot">
12
        <Canvas.Resources>
13
            <Style TargetType="Thumb" x:Key="ThumbMoveStyle">
14
                <!--<Setter Property="Margin" Value="10" />-->
15
                <Setter Property="Template">
16
                    <Setter.Value>
17
                        <ControlTemplate TargetType="Thumb">
18
                            <Grid >
19
                                <Rectangle x:Name="RectThumb" Width="{TemplateBinding  Width}" Height="{TemplateBinding Height}" Fill="#ffcfcfce"  
20
                                           Opacity="0.6" Stroke="#ff6a6b68" StrokeDashArray="2 2" MouseLeftButtonDown="RectThumb_MouseLeftButtonDown">
21
                                </Rectangle>
22
                                <telerik:RadDropDownButton DropDownIndicatorVisibility="Collapsed" IsHitTestVisible="False" x:Name="Date_Drop" Opacity="0.01" 
23
                                                           Loaded="RadDropDownButton_Loaded" VerticalAlignment="Bottom"
24
                                                           Width="{Binding ElementName=RectThumb, Path=Width}" Height="{Binding ElementName=RectThumb, Path=Height}">
25
                                    <telerik:RadDropDownButton.DropDownContent>
26
                                        <telerik:RadCalendar x:Name="Date_Calendar"  Width="{Binding ElementName=RectThumb, Path=Width}" 
27
                                                             MinHeight="300" MinWidth="300" telerik:StyleManager.Theme="Windows8"
28
                                                             Height="{Binding ElementName=RectThumb, Path=Height}" Loaded="Date_Calendar_Loaded"/>
29
                                    </telerik:RadDropDownButton.DropDownContent>
30
                                </telerik:RadDropDownButton>
31
                            </Grid>
32
                        </ControlTemplate>
33
                    </Setter.Value>
34
                </Setter>
35
            </Style>
36
            <Style TargetType="Thumb" x:Key="ThumbTextStyle">
37
                <Setter Property="Width" Value="20" />
38
                <Setter Property="Opacity" Value="0.7" />
39
                <Setter Property="Height" Value="20" />
40
                <Setter Property="Template">
41
                    <Setter.Value>
42
                        <ControlTemplate TargetType="Thumb">
43
                                <!--<TextBox Text="" x:Name="testText" Loaded="testText_Loaded"  Width="{Binding Width, ElementName=Self}" Height="{Binding Height, ElementName=Self}"/>-->
44
                                <Rectangle Fill="#ff8ef814" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
45
                                                            Opacity="0.6" MouseLeftButtonDown="RectThumb_MouseLeftButtonDown"/>                                
46
                        </ControlTemplate>
47
                    </Setter.Value>
48
                </Setter>
49
            </Style>
50
            <Style TargetType="Thumb" x:Key="ThumbResizeStyle">
51
                <!--<Setter Property="Cursor" Value="None" />-->
52
                <Setter Property="Margin" Value="-10" />
53
                <Setter Property="Width" Value="20" />
54
                <Setter Property="Cursor" Value="Hand"/>
55
                <Setter Property="Opacity" Value="1" />
56
                <Setter Property="Height" Value="20" />
57
                <Setter Property="Template">
58
                    <Setter.Value>
59
                        <ControlTemplate TargetType="Thumb">
60
                            <Ellipse Stroke="#ff2e3436"  StrokeThickness="2"
61
                                     HorizontalAlignment="Center" Width="16"  Height="16" Margin="0,0,0,0" Canvas.ZIndex="1">
62
                                <Ellipse.Fill>
63
                                    <SolidColorBrush Color="#ff8ef814" Opacity="0.6"/>
64
                                </Ellipse.Fill>
65
                                <i:Interaction.Behaviors>
66
                                    <behavior:ExpandingMouseOver ScaleFactor="2"/>
67
                                </i:Interaction.Behaviors>
68
                            </Ellipse>
69
                        </ControlTemplate>
70
                    </Setter.Value>
71
                </Setter>
72

    
73
            </Style>
74
            <Style TargetType="Thumb" x:Key="ThumbArcControlStyle">
75
                <!--<Setter Property="Cursor" Value="None" />-->
76
                <Setter Property="Margin" Value="-10" />
77
                <Setter Property="Width" Value="20" />
78
                <Setter Property="Opacity" Value="0.6" />
79
                <Setter Property="Cursor" Value="Hand"/>
80
                <Setter Property="Height" Value="20" />
81
                <Setter Property="Template">
82
                    <Setter.Value>
83
                        <ControlTemplate TargetType="Thumb">
84
                            <Ellipse Stroke="#ff2e3436"  StrokeThickness="2" MouseLeftButtonDown="ControlPointMouseLeftButtonDown"
85
                                     HorizontalAlignment="Center" Width="20"  Height="20" Margin="0,0,0,0" Canvas.ZIndex="1">
86
                                <Ellipse.Fill>
87
                                    <SolidColorBrush Color="#fff814df" Opacity="0.6"/>
88
                                </Ellipse.Fill>
89
                                <i:Interaction.Behaviors>
90
                                    <behavior:ExpandingMouseOver ScaleFactor="2"/>
91
                                </i:Interaction.Behaviors>
92
                            </Ellipse>
93
                        </ControlTemplate>
94
                    </Setter.Value>
95
                </Setter>
96
            </Style>
97
            <Style TargetType="Thumb" x:Key="ThumbResizeNoEdgeStyle">
98
                <!--<Setter Property="Cursor" Value="None" />-->
99
                <Setter Property="Width" Value="15" />
100
                <Setter Property="Opacity" Value="0.7" />
101
                <Setter Property="Height" Value="15" />
102
                <Setter Property="Template">
103
                    <Setter.Value>
104
                        <ControlTemplate TargetType="Thumb">
105
                            <Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="Black" Background="#FF312C2C" BorderThickness="1">
106
                                <Rectangle Fill="#ae8237f3"/>
107
                            </Border>
108
                        </ControlTemplate>
109
                    </Setter.Value>
110
                </Setter>
111
            </Style>
112
            <Style TargetType="Thumb" x:Key="ThumbRotateStyle">
113
                <!--<Setter Property="Cursor" Value="None" />-->
114
                <Setter Property="Margin" Value="-15" />
115
                <Setter Property="Width" Value="30" />
116
                <Setter Property="Height" Value="30" />
117
                <Setter Property="Template">
118
                    <Setter.Value>
119
                        <ControlTemplate TargetType="Thumb">
120
                            <Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="Black" Background="#FF312C2C" BorderThickness="1">
121
                                <Rectangle Fill="#FF07B4FF">
122
                                    <i:Interaction.Behaviors>
123
                                        <behavior:ExpandingMouseOver ScaleFactor="2"/>
124
                                    </i:Interaction.Behaviors>
125
                                </Rectangle>
126
                            </Border>
127
                        </ControlTemplate>
128
                    </Setter.Value>
129
                </Setter>
130
            </Style>
131
            <Style TargetType="Thumb" x:Key="ThumbSingleRotateStyle">
132
                <!--<Setter Property="Cursor" Value="None" />-->
133
                <Setter Property="Margin" Value="-15" />
134
                <Setter Property="Width" Value="20" />
135
                <Setter Property="Height" Value="30" />
136
                <Setter Property="Template">
137
                    <Setter.Value>
138
                        <ControlTemplate TargetType="Thumb">
139
                            <!--</Border>-->
140
                            <!--<Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="Black" Background="#FF312C2C" BorderThickness="1">-->
141
                            <StackPanel x:Name="RotateThumb">
142
                                <Ellipse Stroke="#ff2e3436" Fill="#ff18b7fc" StrokeThickness="2"
143
                                                HorizontalAlignment="Center" Width="16"  Height="15" Margin="0,5,0,0" Canvas.ZIndex="99">
144
                                    <i:Interaction.Behaviors>
145
                                        <behavior:ExpandingMouseOver ScaleFactor="1.5"/>
146
                                    </i:Interaction.Behaviors></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 Style="{StaticResource ThumbArcControlStyle}"/>-->
156
            <Thumb x:Name="DragThumb" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  BorderThickness="1"  Opacity="1"
157
                   DragStarted="drag_DragStarted" DragCompleted="drag_DragCompleted" Loaded="DragThumb_Loaded"  MouseDoubleClick="DragThumb_MouseDoubleClick"
158
                   DragDelta="DragThumb_DragDelta" Canvas.ZIndex="81" Style="{StaticResource ThumbMoveStyle}" RenderTransformOrigin="0,0">
159
                <Thumb.RenderTransform>
160
                    <TransformGroup>
161
                        <!--<CompositeTransform x:Name="trRotate"/>-->
162
                        <RotateTransform x:Name="trRotateThumb"/>
163
                    </TransformGroup>
164
                </Thumb.RenderTransform>
165
            </Thumb>
166
        </Canvas>
167
        <Grid x:Name="AdornerBorder" Background="Transparent" RenderTransformOrigin="0,0" Canvas.ZIndex="80">
168
            <Grid.RowDefinitions>
169
                <RowDefinition Height="0"/>
170
                <RowDefinition/>
171
                <RowDefinition Height="0"/>
172
            </Grid.RowDefinitions>
173
            <Grid.ColumnDefinitions>
174
                <ColumnDefinition Width="0"/>
175
                <ColumnDefinition/>
176
                <ColumnDefinition Width="0"/>
177
            </Grid.ColumnDefinitions>
178
            <Grid.RenderTransform>
179
                <RotateTransform x:Name="trRotate"/>
180
            </Grid.RenderTransform>
181
            <Thumb x:Name="rotateTop" Style="{StaticResource ThumbSingleRotateStyle}"  Grid.Column="1" HorizontalAlignment="Stretch" 
182
                                VerticalAlignment="Top" Margin="0,-30"  Grid.ColumnSpan="3" Grid.RowSpan="3"  Canvas.ZIndex="99" 
183
                                Width="30" Height="30" DragStarted="rotate_DragStarted" MouseMove="rotate_MouseMove" DragDelta="rotate_DragDelta"
184
                    DragCompleted="rotate_DragCompleted">
185
            </Thumb>
186
        </Grid>
187
    </Canvas>
188
</UserControl>
클립보드 이미지 추가 (최대 크기: 500 MB)