프로젝트

일반

사용자정보

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

markus / KCOM / Controls / PrintControl.xaml @ 86bff326

이력 | 보기 | 이력해설 | 다운로드 (25 KB)

1
<UserControl x:Class="KCOM.Control.PrintControl"
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:wrappanel ="clr-namespace:KCOM.WrapPanel"
6
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7
    mc:Ignorable="d"
8
    xmlns:converter="clr-namespace:KCOM.Common.Converter"
9
    xmlns:telInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
10
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
11
    xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
12
    d:DesignHeight="550" d:DesignWidth="650">
13
    
14
    <UserControl.Resources>
15
        <converter:BoolToVisibleConverter x:Key="BoolToVisibleConverter" />
16
        <Style TargetType="telerik:GridViewCell" x:Key="GridViewCellCenterStyle">
17
            <Setter Property="HorizontalAlignment" Value="Center"/>
18
        </Style>
19
        <!--좌측 썸네일 스크롤 스타일-->
20
        <Style x:Key="CustomThumbStyle" TargetType="Thumb">
21
            <Setter Property="Template">
22
                <Setter.Value>
23
                    <ControlTemplate TargetType="Thumb">
24
                        <Rectangle Width="10" Height="20" Fill="#FF45BAFF"/>
25
                        <!--<Rectangle Width="10" Height="20" Fill="#FFFF0000"/>-->
26
                    </ControlTemplate>
27
                </Setter.Value>
28
            </Setter>
29
        </Style>
30
        <!--강인구-->
31

    
32
    </UserControl.Resources>
33
    <Grid x:Name="LayoutRoot" Background="White">
34
        <Grid.ColumnDefinitions>
35
            <ColumnDefinition Width="4*"/>
36
            <ColumnDefinition Width="6*"/>
37
        </Grid.ColumnDefinitions>
38
        <Grid.RowDefinitions>
39
            <RowDefinition Height="Auto"/>
40
            <RowDefinition Height="8*"/>
41
        </Grid.RowDefinitions>
42

    
43
        <Border Grid.Row="0" Grid.ColumnSpan="2" BorderBrush="#232323" BorderThickness="0,0,0,0.5">
44
            <!--오른쪽 상단-->
45
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
46
                <StackPanel Orientation="Horizontal" Margin="3">
47
                    <TextBlock Text="Slip" VerticalAlignment="Center" Margin="3"/>
48
                    <TextBlock Text="{Binding vpSlip}" Foreground="#007ACC" VerticalAlignment="Center" Margin="3" FontWeight="ExtraBold"/>
49
                </StackPanel>
50
                <StackPanel Orientation="Horizontal" Margin="3">
51
                    <TextBlock Text="VP" VerticalAlignment="Center" Margin="3"/>
52
                    <TextBlock Text="{Binding vpTitle}" Foreground="#007ACC" VerticalAlignment="Center" Margin="3" 
53
                               FontWeight="ExtraBold"/>
54
                </StackPanel>
55
                <StackPanel Orientation="Horizontal" Margin="3">
56
                    <TextBlock Text="Pages" VerticalAlignment="Center" Margin="3"/>
57
                    <TextBlock Text="{Binding PagesCount}" Foreground="#007ACC" VerticalAlignment="Center" Margin="3" FontWeight="ExtraBold"/>
58
                </StackPanel>
59
            </StackPanel>
60
        </Border>
61

    
62
        <Border Grid.Row="1" Grid.Column="0" BorderBrush="#232323" BorderThickness="0,0,0,0">
63
            <telerik:GroupBox Header="Preview : Composite" Margin="3" telerik:StyleManager.Theme="Office2016">
64
                <Grid>
65
                    <Grid.RowDefinitions>
66
                        <RowDefinition Height="30"/>
67
                        <RowDefinition Height="*"/>
68
                        <RowDefinition Height="30"/>
69
                        <RowDefinition Height="50"/>
70
                    </Grid.RowDefinitions>
71
                    <!--<Border Grid.Row="1" Background="#5F5F5F" MinWidth="200">-->
72
                    <Border Grid.Row="1" Background="#5F5F5F" MinWidth="200">
73
                        <!--잠시 제외 뷰어 부분-->
74
                        <Viewbox x:Name="PrintView" >
75
                            <!--<Canvas x:Name="printCanvas" Background="{Binding Source={x:Static local:DataModel.Instance}, Path=BackgroundImage, Mode=OneWay}">-->
76
                            <!--<Canvas x:Name="printCanvas" Background="{Binding Path=Back_Image}">-->
77
                            <Canvas x:Name="printCanvas">
78
                                
79
                            </Canvas>
80
                        </Viewbox>
81
                    </Border>
82
                    <telerik:RadBusyIndicator  Name="indicator" Grid.Row="1" telerik:StyleManager.Theme="Office2016" IsIndeterminate="True"/>
83
                    <Border Grid.Row="3">
84
                        <Grid>
85
                            <Grid.ColumnDefinitions>
86
                                <ColumnDefinition Width="6*"/>
87
                                <ColumnDefinition Width="4*"/>
88
                            </Grid.ColumnDefinitions>
89
                            <telerik:RadSlider x:Name="sliderPages" Value="{Binding Path=CurrentValue}" Maximum="{Binding Path=PagesCount}" 
90
                                   telerik:StyleManager.Theme="Office2016" Margin="5" HandlesVisibility="Visible"
91
                                   IsMoveToPointEnabled="True" IsSnapToTickEnabled="True" TickFrequency="1" SmallChange="1" Minimum="1" 
92
                                   ValueChanged="sliderPages_ValueChanged" ThumbStyle="{StaticResource CustomThumbStyle}"
93
                                   VerticalAlignment="Center"
94
                                   MiddleThumbClickMode="None" Cursor="Hand" DragCompleted="sliderPages_DragCompleted" 
95
                                   DragStarted="sliderPages_DragStarted" HorizontalAlignment="Stretch" />
96
                            <TextBlock Grid.Column="1" Text="{Binding Value,StringFormat='Page No:{0}', ElementName=sliderPages}" VerticalAlignment="Center"
97
                                       Margin="4"/>
98
                        </Grid>
99
                    </Border>
100

    
101
                    <Border Grid.Row="2">
102
                        <!--<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">-->
103
                        <Grid>
104
                            <Grid.ColumnDefinitions>
105
                                <ColumnDefinition Width="6*"/>
106
                                <ColumnDefinition Width="4*"/>
107
                            </Grid.ColumnDefinitions>
108

    
109
                            <ProgressBar Name="ProgressState" telerik:StyleManager.Theme="Office2016" Margin="3"/>
110
                        </Grid>
111
                    </Border>
112
                    <TextBlock Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="100,164,0,0" 
113
                               Foreground="Red" VerticalAlignment="Top" x:Name="testMsg"/>
114
                </Grid>
115
            </telerik:GroupBox>
116
        </Border>
117

    
118
        <Border Grid.Row="1" Grid.Column="1" BorderBrush="#232323" BorderThickness="0,0,0,0">
119
            <Grid>
120
                <Grid.RowDefinitions>
121
                    <RowDefinition Height="100"/>
122
                    <RowDefinition Height="60"/>
123
                    <RowDefinition Height="80"/>
124
                    <RowDefinition Height="80"/>
125
                    <RowDefinition Height="7*"/>
126
                </Grid.RowDefinitions>
127

    
128
                <telerik:GroupBox Header="Print Option" Margin="3" telerik:StyleManager.Theme="Office2016">
129
                    <Grid>
130
                        <Grid.RowDefinitions>
131
                            <RowDefinition Height="Auto" />
132
                            <RowDefinition Height="Auto"  MinHeight="50" />
133
                        </Grid.RowDefinitions>
134
                        <!--<StackPanel HorizontalAlignment="Stretch" Orientation="Horizontal">
135
                            <telerik:RadRadioButton Content="Current page" telerik:StyleManager.Theme="Office2016" Margin="2"/>
136
                            <telerik:RadRadioButton Content="Range of print" telerik:StyleManager.Theme="Office2016" Margin="2"/>
137
                            <telerik:RadRadioButton Content="User defined" telerik:StyleManager.Theme="Office2016" Margin="2"/>
138
                            <telerik:RadRadioButton Content="All pages" telerik:StyleManager.Theme="Office2016" Margin="2"/>
139
                        </StackPanel>-->
140
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
141
                            <CheckBox x:Name="chkOnlyMarkup" IsChecked="True" HorizontalAlignment="Right"
142
                                          VerticalAlignment="Center"  FontSize="10" FontWeight="Bold" telerik:StyleManager.Theme="Office2016" 
143
                                          Margin="0,5,4,0" Foreground="Black" Grid.Row="0"                                          
144
                                          Checked="chkOnlyMarkup_Checked" Unchecked="chkOnlyMarkup_Checked">
145
                                <CheckBox.Content>
146
                                    <TextBlock Text="Commented Page only" Margin="0,-2,0,0" FontSize="12"/>
147
                                </CheckBox.Content>
148
                            </CheckBox>
149
                            <!--<CheckBox IsChecked="True" HorizontalAlignment="Right"
150
                                          VerticalAlignment="Center"  FontSize="10" FontWeight="Bold" telerik:StyleManager.Theme="Office2016" 
151
                                          Margin="0,5,4,0" Foreground="Black" Grid.Row="0">
152
                                <CheckBox.Content>
153
                                    <TextBlock Text="User Color" Margin="0,-2,0,0" FontSize="12"/>
154
                                </CheckBox.Content>
155
                            </CheckBox>-->
156
                        </StackPanel>
157

    
158
                        <StackPanel Orientation="Horizontal" Grid.Row="1" >
159
                            <telerik:RadRadioButton Tag="Current" Content="Current" telerik:StyleManager.Theme="Office2016" Margin="5"
160
                                                            Name="btCurrentPages" Grid.Row="1" Checked="PageSelect_Checked" IsChecked="True"/>
161
                            <telerik:RadRadioButton Tag="RangePrint" Grid.Column="1" Content="Range of Print" telerik:StyleManager.Theme="Office2016"  
162
                                                            Margin="5" Name="btRagePages" Grid.Row="1"  Checked="PageSelect_Checked"/>
163
                            <telerik:RadRadioButton Tag="UserDefined" Grid.Column="2" Content="User defined" telerik:StyleManager.Theme="Office2016"  
164
                                                            Margin="5" Grid.Row="1" Checked="PageSelect_Checked"/>
165
                            <telerik:RadRadioButton Tag="AllPrint" Grid.Column="3" Content="All Pages" telerik:StyleManager.Theme="Office2016"  
166
                                                            Margin="5"   Grid.Row="1" Checked="PageSelect_Checked"/>
167
                        </StackPanel>
168

    
169
                    </Grid>
170
                </telerik:GroupBox>
171
                <!--프린트 범위-->
172
                <telerik:GroupBox x:Name="Selected_Print" telerik:StyleManager.Theme="Office2016" Grid.Row="1" Header="Selected Print" Margin="3">
173
                    <Grid>
174
                        <telerik:RadComboBox x:Name="cbPrint" Width="300" telerik:StyleManager.Theme="Office2016" HorizontalAlignment="Left"></telerik:RadComboBox>
175
                    </Grid>
176
                </telerik:GroupBox>
177

    
178
                <telerik:GroupBox telerik:StyleManager.Theme="Office2016" Grid.Row="2" Header="Print Range" Margin="3">
179
                    <Grid x:Name="rangeView">
180
                        <!--Current Grid Start-->
181
                        <Grid Name="GridCurrentPage" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"
182
                              Visibility="Visible">
183
                            <StackPanel>
184
                                <TextBlock Text="Print out the page currently displayed on the screen !"/>
185
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="5">
186
                                    <TextBlock Text="Current Page : "/>
187
                                    <TextBlock Text="{Binding Value,StringFormat=' {0}', ElementName=sliderPages}" Foreground="#FF45BAFF" 
188
                                                   FontWeight="Bold"/>
189
                                </StackPanel>
190
                            </StackPanel>
191
                        </Grid>
192
                        <!--Current Grid End-->
193
                        <!--Range of Print Start-->
194
                        <Grid Name="GridRangePages" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed"  Margin="0,0,0,0">
195
                            <Grid.ColumnDefinitions>
196
                                <ColumnDefinition Width="Auto"/>
197
                                <ColumnDefinition/>
198
                                <ColumnDefinition/>
199
                                <ColumnDefinition/>
200
                            </Grid.ColumnDefinitions>
201
                            <TextBlock Text="Select Page Number : " VerticalAlignment="Center"/>
202
                            <telInput:RadNumericUpDown Grid.Column="1" Name="stPageNo" NumberDecimalDigits="0" ValueChanged="PageNo_ValueChanged"
203
                                                               telerik:StyleManager.Theme="Office2016" Minimum="1"/>
204
                            <TextBlock Text="~"   Grid.Column="2" VerticalAlignment="Center"/>
205
                            <telInput:RadNumericUpDown Grid.Column="3" Name="edPageNo" NumberDecimalDigits="0" ValueChanged="PageNo_ValueChanged"
206
                                                               telerik:StyleManager.Theme="Office2016" Minimum="1" />
207
                        </Grid>
208
                        <!--Range of Print End-->
209
                        <!--User defined Start-->
210
                        <Grid Name="GridDefinePages" VerticalAlignment="Center" HorizontalAlignment="Stretch" Visibility="Collapsed"  Margin="0,0,0,0">
211
                            <Border>
212
                                <Grid>
213
                                    <Grid.ColumnDefinitions>
214
                                        <ColumnDefinition  Width="Auto"/>
215
                                        <ColumnDefinition  Width="3*"/>
216
                                        <ColumnDefinition  Width="2*"/>
217
                                    </Grid.ColumnDefinitions>
218
                                    <Grid.RowDefinitions>
219
                                        <RowDefinition Height="Auto"/>
220
                                        <RowDefinition Height="Auto"/>
221
                                    </Grid.RowDefinitions>
222
                                    <TextBlock Text="Input Page Number" VerticalAlignment="Center"
223
                                                       Margin="10,0" />
224
                                    <TextBox Name="txtDefinedPages" Grid.Column="1" Margin="2"
225
                                                     TextChanged="txtDefinedPages_TextChanged"
226
                                                     Text="{Binding Path=DefinedPagesStrings,Mode=TwoWay,ValidatesOnExceptions=True,
227
                                                     NotifyOnValidationError=True}"/>
228
                                    <telerik:RadButton x:Name="btnClearDefinedPages" Content="Clear" Grid.Column="2" Margin="2"  
229
                                                               telerik:StyleManager.Theme="Office2016" Click="btnClearDefinedPages_Click"/>
230
                                    <TextBlock Grid.Row="1" Grid.ColumnSpan="3" 
231
                                                       HorizontalAlignment="Center" Margin="5,5">
232
                                        <TextBlock.Inlines>
233
                                            <Run>Enter page numbers and / or page ranges</Run>
234
                                            <LineBreak/>
235
                                            <Run>separated by commas</Run>
236
                                            <Underline>
237
                                                <Run Foreground="Red" FontSize="11">[For example, 1,3,5-12]</Run>
238
                                            </Underline>
239
                                        </TextBlock.Inlines>
240
                                    </TextBlock>
241
                                </Grid>
242
                            </Border>
243
                        </Grid>
244
                        <!--User defined  Start-->
245
                        <!--All Pages Start-->
246
                        <Grid Name="GridAllPages" VerticalAlignment="Center" HorizontalAlignment="Center" 
247
                                      Grid.Row="2" Visibility="Collapsed"  Margin="0,0,0,0">
248
                            <StackPanel>
249
                                <TextBlock Text="Indicates all of the pages in the current document are to be printed." TextWrapping="Wrap"
250
                                           TextAlignment="Center"/>
251
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="3">
252
                                    <TextBlock Text="Document Pages : " Foreground="#FF006AC1"/>
253
                                    <TextBlock Text="{Binding Path=PagesCount}" Foreground="#FF45BAFF" 
254
                                                   FontWeight="Bold"/>
255
                                </StackPanel>
256
                            </StackPanel>
257
                        </Grid>
258
                        <!--All Pages End-->
259
                    </Grid>
260
                </telerik:GroupBox>
261
                <!--프린트 범위-->
262

    
263
                <telerik:GroupBox telerik:StyleManager.Theme="Office2016" Grid.Row="3" Margin="3" Header="Commented Pages(Click To Select Page)">
264
                    <ListBox telerik:StyleManager.Theme="Office2016" x:Name="CommentPageList" Foreground="Black"  
265
                                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
266
                                     SelectionChanged="CommentPageList_SelectionChanged">
267
                        <ListBox.ItemsPanel>
268
                            <ItemsPanelTemplate>
269
                                <wrappanel:WrapPanel Orientation="Horizontal" VerticalAlignment="Center"/>
270
                            </ItemsPanelTemplate>
271
                        </ListBox.ItemsPanel>
272
                        <ListBox.ItemTemplate>
273
                            <DataTemplate>
274
                                <Border Background="#FF45BA44" BorderThickness="0.5" BorderBrush="#232323" Width="20" Height="20">
275
                                    <TextBlock Text="{Binding PageNumber}" Foreground="White" VerticalAlignment="Center" Margin="2" 
276
                                                     HorizontalAlignment="Center"/>
277
                                </Border>
278
                            </DataTemplate>
279
                        </ListBox.ItemTemplate>
280
                    </ListBox>
281
                </telerik:GroupBox>
282

    
283
                <Border Grid.Row="4" Margin="3">
284
                    <Grid>
285
                        <Grid.RowDefinitions>
286
                            <RowDefinition Height="8.5*"/>
287
                            <RowDefinition Height="1.5*"/>
288
                        </Grid.RowDefinitions>
289
                        <telerik:GroupBox telerik:StyleManager.Theme="Office2016" Grid.Row="0" Margin="0"
290
                                          Header="Commented User list">
291
                            <telerik:RadGridView Grid.Row="0" telerik:StyleManager.Theme="Office2016" IsFilteringAllowed="False" ScrollViewer.VerticalScrollBarVisibility="Auto"
292
                                                     AutoGenerateColumns="False" ShowGroupPanel="False" ShowGroupFooters="False"
293
                                                                                                     CanUserDeleteRows="True" CanUserInsertRows="False"  EditTriggers="TextInput" 
294
                                                     RowIndicatorVisibility="Collapsed" x:Name="gridViewMarkup" Margin="2" 
295
                                                     SelectionChanged="gridViewMarkup_SelectionChanged" BorderBrush="#232323" BorderThickness="0.5"
296
                                                     SelectionMode="Multiple" Background="White" SelectionUnit="FullRow" IsBusy="False">
297
                                <telerik:RadGridView.Columns>
298
                                    <telerik:GridViewSelectColumn />
299
                                    <telerik:GridViewDataColumn Header="Color"  IsReadOnly="True">
300
                                        <telerik:GridViewDataColumn.CellTemplate>
301
                                            <DataTemplate>
302
                                                <Grid Background="AliceBlue">
303
                                                    <!--<Rectangle Fill="{Binding DisplayColor, Converter={StaticResource StringToColorConverter}}" />-->
304
                                                    <Rectangle Fill="{Binding DisplayColor}" />
305
                                                    <TextBlock Text="Color" Foreground="#00000000"/>
306
                                                </Grid>
307
                                            </DataTemplate>
308
                                        </telerik:GridViewDataColumn.CellTemplate>
309
                                    </telerik:GridViewDataColumn>
310

    
311
                                    <telerik:GridViewDataColumn Width="1*" DataMemberBinding="{Binding Depatment}" Header="Department" IsReadOnly="True"/>
312
                                    <telerik:GridViewDataColumn Width="1*" DataMemberBinding="{Binding UserName}" Header="User Name" IsReadOnly="True"/>
313
                                    <telerik:GridViewDataColumn Width="0.5*" DataMemberBinding="{Binding PageCount}" Header="Pages" IsReadOnly="True"/>
314
                                    <telerik:GridViewDataColumn Width="1*" DataMemberBinding="{Binding Description}" Header="Descriptions" IsReadOnly="True"/>
315

    
316
                                </telerik:RadGridView.Columns>
317
                            </telerik:RadGridView>
318
                        </telerik:GroupBox>
319
                        <Border Grid.Row="1">
320
                            <Grid>
321
                                <Grid.ColumnDefinitions>
322
                                    <ColumnDefinition/>
323
                                    <ColumnDefinition/>
324
                                    <ColumnDefinition/>
325
                                    <ColumnDefinition/>
326
                                    <!--강인구 추가(Export)-->
327
                                    <ColumnDefinition/>
328

    
329
                                </Grid.ColumnDefinitions>
330
                                <Border  Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="0">
331
                                    <Grid>
332
                                        <Grid.ColumnDefinitions>
333
                                            <ColumnDefinition Width="7*"/>
334
                                            <ColumnDefinition Width="3*"/>
335
                                        </Grid.ColumnDefinitions>
336
                                    </Grid>
337
                                </Border>
338
                                <telerik:RadButton x:Name="btnWholePrint" Content="Print" Grid.Row="4" Grid.Column="2" Margin="0"
339
                                           telerik:StyleManager.Theme="Office2016" Background="#FF45BAFF" Foreground="White"
340
                                           Click="PrintMethod"/>
341
                                <!--강인구 추가(Export)-->
342
                                <telerik:RadButton x:Name="btnWholeExport" Content="Export" Grid.Row="4" Grid.Column="2" Margin="0"
343
                                           telerik:StyleManager.Theme="Office2016" Background="#FF45BAFF" Foreground="White"
344
                                           Click="ExportMethod" Visibility="Collapsed"/>
345

    
346
                                <Border Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="0">
347
                                    <Grid>
348
                                        <Grid.RowDefinitions>
349
                                            <RowDefinition/>
350
                                            <RowDefinition/>
351
                                        </Grid.RowDefinitions>
352
                                        <Grid.ColumnDefinitions>
353
                                            <ColumnDefinition Width="7*"/>
354
                                            <ColumnDefinition Width="3*"/>
355
                                        </Grid.ColumnDefinitions>
356
                                    </Grid>
357
                                </Border>
358
                            </Grid>
359
                        </Border>
360
                    </Grid>
361
                </Border>
362
            </Grid>
363
        </Border>
364
        <telerik:RadBusyIndicator x:Name="printIndy"  Visibility="{Binding IsBusy, Converter={StaticResource BoolToVisibleConverter}, RelativeSource={RelativeSource Self}}"
365
                                          Grid.Row="1"
366
                                          Grid.ColumnSpan="2"
367
                                          VerticalAlignment="Stretch"
368
                                          BorderThickness="0"
369
                                          BusyContent="Printing. . ."
370
                                          IsBusy="False"
371
                                          telerik:StyleManager.Theme="Office2016" DisplayAfter="0:0:0.3" />
372
    </Grid>
373
</UserControl>
클립보드 이미지 추가 (최대 크기: 500 MB)