프로젝트

일반

사용자정보

개정판 f1f822e9

IDf1f822e9f92e5aee7771ced9ff1123813c8a29b2
상위 c095f3cb
하위 3abe8d4e

김태성이(가) 일년 이상 전에 추가함

issue #00000 svg 기능 수정

Change-Id: Ic1575964db1f861ca637c7073dfa382fee4bbcd4

차이점 보기:

KCOM/Controls/Symbol.xaml
1
<UserControl x:Class="KCOM.Controls.Symbol"
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:common="clr-namespace:KCOM.Common"
6
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
7
             xmlns:WrapPanel ="clr-namespace:KCOM.WrapPanel"
8
             xmlns:local="clr-namespace:KCOM.Controls"
9
              xmlns:ZoomAndPan="clr-namespace:ZoomAndPan;assembly=ZoomAndPan"
10
      	     xmlns:telerikDragDrop="clr-namespace:Telerik.Windows.DragDrop;assembly=Telerik.Windows.Controls"
11
             	 xmlns:dragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"
12
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
13
             xmlns:converter="clr-namespace:KCOM.Common.Converter"
14
             xmlns:Behaviors="clr-namespace:KCOM.Behaviors"
15
             mc:Ignorable="d" Background="#f5f5f5"
16
             d:DesignHeight="900" d:DesignWidth="300">
1
<UserControl
2
    x:Class="KCOM.Controls.Symbol"
3
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
    xmlns:Behaviors="clr-namespace:KCOM.Behaviors"
6
    xmlns:WrapPanel="[WrapPanel ]clr-namespace:KCOM.WrapPanel"
7
    xmlns:ZoomAndPan="clr-namespace:ZoomAndPan;assembly=ZoomAndPan"
8
    xmlns:common="clr-namespace:KCOM.Common"
9
    xmlns:converter="clr-namespace:KCOM.Common.Converter"
10
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
11
    xmlns:dragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"
12
    xmlns:local="clr-namespace:KCOM.Controls"
13
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
14
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
15
    xmlns:telerikDragDrop="clr-namespace:Telerik.Windows.DragDrop;assembly=Telerik.Windows.Controls"
16
    d:DesignHeight="900"
17
    d:DesignWidth="300"
18
    Background="#f5f5f5"
19
    mc:Ignorable="d">
17 20
    <UserControl.Resources>
18
        <converter:SvgImageConverter x:Key="SvgImageConverter"/>
19
        <Style x:Key="CustomDragVisualStyle2" TargetType="telerik:DragVisual" BasedOn="{StaticResource DragVisualStyle}">
21
        <converter:SvgImageConverter x:Key="SvgImageConverter" />
22
        <Style
23
            x:Key="CustomDragVisualStyle2"
24
            BasedOn="{StaticResource DragVisualStyle}"
25
            TargetType="telerik:DragVisual">
20 26
            <Setter Property="Background" Value="Transparent" />
21 27
            <Setter Property="BorderThickness" Value="0" />
22
            <Setter Property="Margin"  Value="0" />
23
            <Setter Property="Padding"  Value="0" />
28
            <Setter Property="Margin" Value="0" />
29
            <Setter Property="Padding" Value="0" />
24 30
        </Style>
25
        <Style TargetType="telerik:RadListBoxItem" BasedOn="{StaticResource RadListBoxItemStyle}">
26
            <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True"/>
31
        <Style BasedOn="{StaticResource RadListBoxItemStyle}" TargetType="telerik:RadListBoxItem">
32
            <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
27 33
            <!--<Setter Property="telerik:TouchManager.DragStartTrigger" Value="TapHoldAndMove"/>-->
28 34
        </Style>
29 35
        <DataTemplate x:Key="SymbolTemplate_Private">
30
            <StackPanel MouseLeftButtonDown="Move_Symbol" AllowDrop="False" MouseLeave="StackPanel_MouseLeave" MouseUp="StackPanel_MouseUp" ToolTipService.ToolTip="{Binding Name}">
36
            <StackPanel
37
                AllowDrop="False"
38
                MouseLeave="StackPanel_MouseLeave"
39
                MouseLeftButtonDown="Move_Symbol"
40
                MouseUp="StackPanel_MouseUp"
41
                ToolTipService.ToolTip="{Binding Name}">
31 42
                <Grid>
32 43
                    <StackPanel>
33 44
                        <!--<Border Background="#FF1FA3EB">-->
34 45
                        <Border Background="#FF2A579A">
35
                            <TextBox MaxWidth="200"
36
                                    Background="#FF2A579A"
37
                                    HorizontalAlignment="Center"
38
                                    VerticalAlignment="Center"
39
                                    Foreground="White"
40
                                    Text="{Binding Name}" 
41
                                    x:Name="symbolName"          
42
                                    BorderBrush="#FF2A579A"
43
                                    KeyDown="OnKeyDownHandler"/>
46
                            <TextBox
47
                                x:Name="symbolName"
48
                                MaxWidth="200"
49
                                HorizontalAlignment="Center"
50
                                VerticalAlignment="Center"
51
                                Background="#FF2A579A"
52
                                BorderBrush="#FF2A579A"
53
                                Foreground="White"
54
                                KeyDown="OnKeyDownHandler"
55
                                Text="{Binding Name}" />
44 56
                        </Border>
45
                        <Image Width="200"
57
                        <Image
58
                            x:Name="symbolImage"
59
                            Width="200"
46 60
                            Height="64"
47 61
                            Margin="3"
48 62
                            HorizontalAlignment="Center"
49
                               Source="{Binding ImageUri,Converter={StaticResource SvgImageConverter},UpdateSourceTrigger=PropertyChanged}"
50
                            x:Name="symbolImage"/>
63
                            Source="{Binding ImageUri, Converter={StaticResource SvgImageConverter}, UpdateSourceTrigger=PropertyChanged}" />
51 64
                    </StackPanel>
52
                    <Rectangle Opacity="0.7"
53
                            Stroke="#ff6c6d6d"
54
                            StrokeThickness="1" />
65
                    <Rectangle
66
                        Opacity="0.7"
67
                        Stroke="#ff6c6d6d"
68
                        StrokeThickness="1" />
55 69
                </Grid>
56 70
            </StackPanel>
57 71
        </DataTemplate>
58 72
    </UserControl.Resources>
59
    <Grid  Margin="10">
60
        <telerik:RadTabControl BorderThickness="0" x:Name="RadTab" telerik:StyleManager.Theme="Office2016"  HeaderBackground="#f5f5f5" FontSize="10" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"
61
                               ScrollViewer.HorizontalScrollBarVisibility ="Disabled" SelectedIndex="0" PreviewSelectionChanged="RadTabControl_PreviewSelectionChanged">
73
    <Grid Margin="10">
74
        <telerik:RadTabControl
75
            x:Name="RadTab"
76
            HorizontalAlignment="Stretch"
77
            HorizontalContentAlignment="Stretch"
78
            telerik:StyleManager.Theme="Office2016"
79
            BorderThickness="0"
80
            FontSize="10"
81
            HeaderBackground="#f5f5f5"
82
            PreviewSelectionChanged="RadTabControl_PreviewSelectionChanged"
83
            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
84
            SelectedIndex="0">
62 85

  
63
            <telerik:RadTabItem Header="Private" FontSize="10" FontWeight="Bold" HeaderForeground="{DynamicResource KCOMColor_MarkerBrush}">
86
            <telerik:RadTabItem
87
                FontSize="10"
88
                FontWeight="Bold"
89
                Header="Private"
90
                HeaderForeground="{DynamicResource KCOMColor_MarkerBrush}">
64 91
                <Grid>
65 92
                    <Grid.RowDefinitions>
66
                        <RowDefinition Height="Auto"/>
67
                        <RowDefinition Height="Auto"/>
68
                        <RowDefinition Height="*"/>
93
                        <RowDefinition Height="Auto" />
94
                        <RowDefinition Height="Auto" />
95
                        <RowDefinition Height="*" />
69 96
                    </Grid.RowDefinitions>
70 97

  
71 98
                    <StackPanel Grid.Row="0" Orientation="Vertical">
72 99
                        <Grid Margin="0,10">
73 100
                            <Grid.ColumnDefinitions>
74
                                <ColumnDefinition Width="3*"/>
75
                                <ColumnDefinition Width="3*"/>
76
                                <ColumnDefinition Width="3*"/>
77
                                <ColumnDefinition Width="3*"/>
101
                                <ColumnDefinition Width="3*" />
102
                                <ColumnDefinition Width="3*" />
103
                                <ColumnDefinition Width="3*" />
104
                                <ColumnDefinition Width="3*" />
78 105
                            </Grid.ColumnDefinitions>
79
                            <Button Content="Place"     Grid.Column="0" Click="Place_Symbol"  Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/>
80
                            <Button Content="Capture"  Grid.Column="1" Click="Image_Place_Register"  Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/>
81
                            <Button Content="Register"  Grid.Column="2" Click="Create_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/>
106
                            <Button
107
                                Grid.Column="0"
108
                                Margin="5,0,0,0"
109
                                Padding="5"
110
                                Background="#3d3d3d"
111
                                Click="Place_Symbol"
112
                                Content="Place"
113
                                FontWeight="Normal"
114
                                Foreground="White" />
115
                            <Button
116
                                Grid.Column="1"
117
                                Margin="5,0,0,0"
118
                                Padding="5"
119
                                Background="#3d3d3d"
120
                                Click="Image_Place_Register"
121
                                Content="Capture"
122
                                FontWeight="Normal"
123
                                Foreground="White" />
124
                            <Button
125
                                Grid.Column="2"
126
                                Margin="5,0,0,0"
127
                                Padding="5"
128
                                Background="#3d3d3d"
129
                                Click="Create_Symbol"
130
                                Content="Register"
131
                                FontWeight="Normal"
132
                                Foreground="White" />
82 133
                            <!-- <Button Content="Rename"    Grid.Column="2" Click="Rename_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/> -->
83
                            
84
                            <Button Content="Remove"    Grid.Column="3" Click="Remove_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/>
134

  
135
                            <Button
136
                                Grid.Column="3"
137
                                Margin="5,0,0,0"
138
                                Padding="5"
139
                                Background="#3d3d3d"
140
                                Click="Remove_Symbol"
141
                                Content="Remove"
142
                                FontWeight="Normal"
143
                                Foreground="White" />
85 144
                        </Grid>
86 145
                        <Grid Margin="0,0,0,10">
87 146
                            <Grid.ColumnDefinitions>
88
                                <ColumnDefinition Width="*"/>
147
                                <ColumnDefinition Width="*" />
89 148
                            </Grid.ColumnDefinitions>
90
                            <TextBlock Text="[Tip : Double Click]" Grid.Column="0" FontSize="10" VerticalAlignment="Center" HorizontalAlignment="Right"/>
149
                            <TextBlock
150
                                Grid.Column="0"
151
                                HorizontalAlignment="Right"
152
                                VerticalAlignment="Center"
153
                                FontSize="10"
154
                                Text="[Tip : Double Click]" />
91 155
                        </Grid>
92 156
                    </StackPanel>
93
                    <ScrollViewer x:Name="ScView" Grid.Row="2" >
94
                        <telerik:RadListBox x:Name="lstSymbolPrivate" Background="#f5f5f5" FontWeight="Normal"
95
                                 ItemTemplate="{StaticResource SymbolTemplate_Private}" 
96
                                 MouseDown="lstSymbolPrivate_MouseDown" 
97
                                 PreviewMouseUp="lstSymbolPrivate_PreviewMouseUp"
98
                                 MouseLeave="lstSymbolPrivate_MouseLeave" AllowDrop="False"
99
                                 PreviewMouseWheel ="lstSymbolPrivate_PreviewMouseWheel">
157
                    <ScrollViewer x:Name="ScView" Grid.Row="2">
158
                        <telerik:RadListBox
159
                            x:Name="lstSymbolPrivate"
160
                            AllowDrop="False"
161
                            Background="#f5f5f5"
162
                            FontWeight="Normal"
163
                            ItemTemplate="{StaticResource SymbolTemplate_Private}"
164
                            MouseDown="lstSymbolPrivate_MouseDown"
165
                            MouseLeave="lstSymbolPrivate_MouseLeave"
166
                            PreviewMouseUp="lstSymbolPrivate_PreviewMouseUp"
167
                            PreviewMouseWheel="lstSymbolPrivate_PreviewMouseWheel">
100 168
                            <!--<telerik:RadListBox.DragDropBehavior>
101 169
                                <telerik:ListBoxDragDropBehavior AllowReorder="True" />
102 170
                            </telerik:RadListBox.DragDropBehavior>-->
......
106 174
                                        <DataTemplate>
107 175
                                            <Grid Width="80">
108 176
                                                <Image
109
                                            Source="{Binding ImageUri,Converter={StaticResource SvgImageConverter}}"
110
                                            HorizontalAlignment="Left"/>
177
                                                    HorizontalAlignment="Left"
178
                                                    Source="{Binding ImageUri, Converter={StaticResource SvgImageConverter}}"
179
                                                    Stretch="UniformToFill" />
111 180
                                            </Grid>
112 181
                                        </DataTemplate>
113 182
                                    </Behaviors:RadListBoxDragVisualProvider.DraggedItemTemplate>
......
118 187
                </Grid>
119 188
            </telerik:RadTabItem>
120 189

  
121
            <telerik:RadTabItem Header="Public" FontWeight="Bold" FontSize="10" HeaderForeground="{DynamicResource KCOMColor_MarkerBrush}" >
190
            <telerik:RadTabItem
191
                FontSize="10"
192
                FontWeight="Bold"
193
                Header="Public"
194
                HeaderForeground="{DynamicResource KCOMColor_MarkerBrush}">
122 195
                <Grid>
123 196
                    <Grid.RowDefinitions>
124
                        <RowDefinition Height="Auto"/>
125
                        <RowDefinition Height="*"/>
197
                        <RowDefinition Height="Auto" />
198
                        <RowDefinition Height="*" />
126 199
                    </Grid.RowDefinitions>
127 200

  
128 201
                    <StackPanel Grid.Row="0" Orientation="Vertical">
129 202
                        <Grid Margin="0,10">
130 203
                            <Grid.ColumnDefinitions>
131
                                <ColumnDefinition Width="1*"/>
132
                                <ColumnDefinition Width="3*"/>
204
                                <ColumnDefinition Width="1*" />
205
                                <ColumnDefinition Width="3*" />
133 206
                            </Grid.ColumnDefinitions>
134 207

  
135
                            <TextBlock FontWeight="Normal" VerticalAlignment="Center">Department</TextBlock>
136
                            <telerik:RadComboBox FontWeight="Normal" EmptyText="ALL" Grid.Column="1"  HorizontalAlignment="Stretch" Margin="5" DropDownWidth="*" Background="White" BorderBrush="#d6d6d6" x:Name="deptlist"
137
                                                  ClearSelectionButtonVisibility="Visible" ClearSelectionButtonContent="Show All" SelectionChanged="deptlist_SelectionChanged"/>
208
                            <TextBlock VerticalAlignment="Center" FontWeight="Normal">Department</TextBlock>
209
                            <telerik:RadComboBox
210
                                x:Name="deptlist"
211
                                Grid.Column="1"
212
                                Margin="5"
213
                                HorizontalAlignment="Stretch"
214
                                Background="White"
215
                                BorderBrush="#d6d6d6"
216
                                ClearSelectionButtonContent="Show All"
217
                                ClearSelectionButtonVisibility="Visible"
218
                                DropDownWidth="*"
219
                                EmptyText="ALL"
220
                                FontWeight="Normal"
221
                                SelectionChanged="deptlist_SelectionChanged" />
138 222

  
139 223
                        </Grid>
140 224

  
141 225
                        <Grid Margin="0,0">
142 226
                            <Grid.ColumnDefinitions>
143
                                <ColumnDefinition Width="3*"/>
144
                                <ColumnDefinition Width="3*"/>
145
                                <ColumnDefinition Width="3*"/>
146
                                <ColumnDefinition Width="3*"/>
227
                                <ColumnDefinition Width="3*" />
228
                                <ColumnDefinition Width="3*" />
229
                                <ColumnDefinition Width="3*" />
230
                                <ColumnDefinition Width="3*" />
147 231
                            </Grid.ColumnDefinitions>
148
                            <Button Content="Place" Click="Place_Symbol_Public" Grid.Column="0"  Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/>
149
                            <Button Content="Capture"  Grid.Column="1" Click="Image_Place_Register"  Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/>
150
                            <Button Content="Register" Grid.Column="2" Click="Create_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/>                            
232
                            <Button
233
                                Grid.Column="0"
234
                                Margin="5,0,0,0"
235
                                Padding="5"
236
                                Background="#3d3d3d"
237
                                Click="Place_Symbol_Public"
238
                                Content="Place"
239
                                FontWeight="Normal"
240
                                Foreground="White" />
241
                            <Button
242
                                Grid.Column="1"
243
                                Margin="5,0,0,0"
244
                                Padding="5"
245
                                Background="#3d3d3d"
246
                                Click="Image_Place_Register"
247
                                Content="Capture"
248
                                FontWeight="Normal"
249
                                Foreground="White" />
250
                            <Button
251
                                Grid.Column="2"
252
                                Margin="5,0,0,0"
253
                                Padding="5"
254
                                Background="#3d3d3d"
255
                                Click="Create_Symbol"
256
                                Content="Register"
257
                                FontWeight="Normal"
258
                                Foreground="White" />
151 259
                            <!--<Button Content="Rename" Grid.Column="2" Click="Rename_Symbol_Public" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/>-->
152
                            <Button Content="Remove" Grid.Column="3" Click="Remove_Symbol_Public" Margin="5,0,0,0" FontWeight="Normal" Padding="5"  Background="#3d3d3d" Foreground="White"/>
260
                            <Button
261
                                Grid.Column="3"
262
                                Margin="5,0,0,0"
263
                                Padding="5"
264
                                Background="#3d3d3d"
265
                                Click="Remove_Symbol_Public"
266
                                Content="Remove"
267
                                FontWeight="Normal"
268
                                Foreground="White" />
153 269
                        </Grid>
154 270
                        <Grid Margin="0,10">
155 271
                            <Grid.ColumnDefinitions>
156
                                <ColumnDefinition Width="*"/>
272
                                <ColumnDefinition Width="*" />
157 273
                            </Grid.ColumnDefinitions>
158
                            <TextBlock Text="[Tip : Double Click]" Grid.Column="0" FontSize="10" VerticalAlignment="Center" HorizontalAlignment="Right"/>
274
                            <TextBlock
275
                                Grid.Column="0"
276
                                HorizontalAlignment="Right"
277
                                VerticalAlignment="Center"
278
                                FontSize="10"
279
                                Text="[Tip : Double Click]" />
159 280
                        </Grid>
160 281
                    </StackPanel>
161
                    <ScrollViewer x:Name="ScView_Public" Grid.Row="2" >
162
                        <telerik:RadListBox x:Name="lstSymbolPublic" Background="#f5f5f5" FontWeight="Normal"
163
                                 ItemTemplate="{StaticResource SymbolTemplate_Private}"   AllowDrop="False"
164
                                 MouseDown="lstSymbolPrivate_MouseDown"
165
                                 PreviewMouseUp="lstSymbolPrivate_PreviewMouseUp"
166
                                 MouseLeave="lstSymbolPrivate_MouseLeave"
167
                                 PreviewMouseWheel ="lstSymbolPublic_PreviewMouseWheel">
282
                    <ScrollViewer x:Name="ScView_Public" Grid.Row="2">
283
                        <telerik:RadListBox
284
                            x:Name="lstSymbolPublic"
285
                            AllowDrop="False"
286
                            Background="#f5f5f5"
287
                            FontWeight="Normal"
288
                            ItemTemplate="{StaticResource SymbolTemplate_Private}"
289
                            MouseDown="lstSymbolPrivate_MouseDown"
290
                            MouseLeave="lstSymbolPrivate_MouseLeave"
291
                            PreviewMouseUp="lstSymbolPrivate_PreviewMouseUp"
292
                            PreviewMouseWheel="lstSymbolPublic_PreviewMouseWheel">
168 293
                            <telerik:RadListBox.DragDropBehavior>
169 294
                                <telerik:ListBoxDragDropBehavior AllowReorder="True" />
170 295
                            </telerik:RadListBox.DragDropBehavior>
......
173 298
                                    <Behaviors:RadListBoxDragVisualProvider.DraggedItemTemplate>
174 299
                                        <DataTemplate>
175 300
                                            <Grid>
176
                                                <Image Width="80" x:Name="SymbolImage" Source="{Binding ImageUri,Converter={StaticResource SvgImageConverter}}"/>
301
                                                <Image
302
                                                    x:Name="SymbolImage"
303
                                                    Width="80"
304
                                                    Source="{Binding ImageUri, Converter={StaticResource SvgImageConverter}}"
305
                                                    Stretch="Fill" />
177 306
                                            </Grid>
178 307
                                        </DataTemplate>
179 308
                                    </Behaviors:RadListBoxDragVisualProvider.DraggedItemTemplate>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)