프로젝트

일반

사용자정보

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

markus / KCOM / Controls / SearchPanel.xaml @ 8bd25583

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

1
<UserControl x:Class="KCOM.Controls.SearchPanel"
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:d="http://schemas.microsoft.com/expression/blend/2008" 
6
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
7
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
8
             xmlns:local="clr-namespace:KCOM.Controls"
9
             xmlns:common="clr-namespace:KCOM.Common"
10
             xmlns:Behaviors="clr-namespace:KCOM.Behaviors"
11
             mc:Ignorable="d" Background="White"
12
             d:DesignHeight="900" d:DesignWidth="300">
13
    <UserControl.Resources>
14
        <telerik:InvertedBooleanConverter x:Key="InvertedBooleanConverter"/>
15
        <telerik:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter"/>
16
        <common:ViewerDataModel x:Key="viewDataModel"/>
17
    </UserControl.Resources>
18
    <Grid  Margin="10">
19

    
20
        <Grid.RowDefinitions>
21
            <RowDefinition Height="Auto"/>
22
            <RowDefinition Height="*"/>
23
        </Grid.RowDefinitions>
24
        <StackPanel Orientation="Vertical">
25
            <TextBlock Text="Search : " FontSize="15"/>
26
            <Grid Margin="0,10">
27
                <Grid.ColumnDefinitions>
28
                    <ColumnDefinition Width="8*"/>
29
                    <ColumnDefinition Width="2*"/>
30
                </Grid.ColumnDefinitions>
31
                <TextBox  HorizontalAlignment="Stretch" Style="{StaticResource ClearTextBoxStyle}" Margin="2,0" telerik:StyleManager.Theme="Office2016" AcceptsReturn="False" Background="#FFF3F3F3" BorderThickness="0.5" VerticalContentAlignment="Center" x:Name="tbSearch" IsTabStop="True"/>
32
                <!--<telerik:RadMaskedTextInput Mask="" 
33
                                            HorizontalAlignment="Stretch" Margin="2,0" AcceptsReturn="False" EmptyContent="Input Search Text" IsClearButtonVisible="True" Background="#FFF3F3F3" BorderThickness="0.5" VerticalContentAlignment="Center" x:Name="tbSearch" IsTabStop="True"/>-->
34
                <Button Content="Search" Grid.Column="1" Padding="5" Background="#3d3d3d" Foreground="White" x:Name="btnSearch"/>
35
            </Grid>
36
            <GroupBox Header="Option List">
37
                <StackPanel Margin="1">
38
                    <CheckBox Content="Current page only" Margin="3" x:Name="chkCurrentPageOnly" IsChecked="False"/>
39
                </StackPanel>
40
            </GroupBox>
41
            <GroupBox Header="Search Mode">
42
                <StackPanel Margin="1">
43
                    <RadioButton GroupName="Search" Content="None - search as substring" IsChecked="True" Margin="3" Checked="chkSelectionChangeEvent"  Tag="0"/>
44
                    <RadioButton GroupName="Search" Content="Exact - search string as separate word" Margin="3" Checked="chkSelectionChangeEvent" Tag="1"/>
45
                    <RadioButton GroupName="Search" Content="Smart - find the word in various forms"  Margin="3" Checked="chkSelectionChangeEvent" Tag="2"/>
46
                </StackPanel>
47
                <!--<CheckBox Content="Match whole word" Margin="5"/>-->
48
            </GroupBox>
49

    
50
            <!--<TextBlock Text="Search word or phase in the current document,   and list the result" Margin="20,20" TextWrapping="WrapWithOverflow" Foreground="#FF7C7C7C" FontSize="12"/>-->
51
        </StackPanel>
52
        <Grid Grid.Row="1">
53
            <Grid.RowDefinitions>
54
                <RowDefinition Height="*"/>
55
                <RowDefinition Height="Auto"/>
56
            </Grid.RowDefinitions>
57
            <ListView Style="{StaticResource SimpleListViewStyle}" x:Name="lstSearchWord" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
58
                      BorderThickness="1" Margin="0,10" ItemsSource="{Binding SearchSet}" SelectionChanged="lstSearchWord_SelectionChanged">
59
                <i:Interaction.Behaviors>
60
                    <Behaviors:ListViewColumnSizeAutoBehavior/>
61
                </i:Interaction.Behaviors>
62
                <ListView.ItemContainerStyle>
63
                    <Style TargetType="ListViewItem">
64
                        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
65
                    </Style>
66
                </ListView.ItemContainerStyle>
67
                <ListView.View>
68
                    <GridView>
69
                        <GridViewColumn Header="Page" Width="42" HeaderContainerStyle="{StaticResource GridViewColumnHeaderStyle}">
70
                            <GridViewColumn.CellTemplate>
71
                                <DataTemplate>
72
                                    <Border BorderBrush="Black" Margin="0,5,0,1" BorderThickness="0,0,0,1" HorizontalAlignment="Stretch">
73
                                        <TextBlock Foreground="MediumBlue" FontFamily="Calibri" Margin="3,0,0,2" TextAlignment="Left"
74
                                            Text="{Binding PageNo}" />
75
                                    </Border>
76
                                </DataTemplate>
77
                            </GridViewColumn.CellTemplate>
78
                        </GridViewColumn>
79
                        <GridViewColumn Header="Text" Width="Auto" HeaderContainerStyle="{StaticResource GridViewColumnHeaderStyle}">
80
                            <GridViewColumn.CellTemplate>
81
                                <DataTemplate >
82
                                    <Border BorderBrush="Black"  Margin="-12,5,0,1" BorderThickness="0,0,0,1"  >
83
                                        <TextBlock Foreground="MediumBlue" TextAlignment="Left" FontFamily="Calibri" FontWeight="Bold"
84
                                           Margin="14,0,0,2" Text="{Binding  searchResult.Text}" TextTrimming="WordEllipsis" />
85
                                    </Border>
86
                                </DataTemplate>
87
                            </GridViewColumn.CellTemplate>
88
                        </GridViewColumn>
89
                        <GridViewColumn Header="Position" Width="0"  HeaderContainerStyle="{StaticResource GridViewColumnHeaderStyle}">
90
                            <GridViewColumn.CellTemplate>
91
                                <DataTemplate>
92
                                    <Border BorderBrush="Black" Margin="-12,5,-17,1" BorderThickness="0,0,0,1" >
93
                                        <StackPanel Orientation="Horizontal" Margin="15,0,0,1">
94
                                        <TextBlock Text="{Binding searchResult.Left, StringFormat=N0}" VerticalAlignment="Center"/>
95
                                        <TextBlock Text=","  FontWeight="DemiBold" VerticalAlignment="Center"/>
96
                                        <TextBlock Text="{Binding searchResult.Top, StringFormat=N0}" VerticalAlignment="Center"/>
97
                                        </StackPanel>
98
                                    </Border>
99
                                </DataTemplate>
100
                            </GridViewColumn.CellTemplate>
101
                        </GridViewColumn>
102
                    </GridView>
103
                </ListView.View>
104
            </ListView>
105
            <StackPanel Orientation="Horizontal"  Grid.Row="1" VerticalAlignment="Top">
106
                <TextBlock FontSize="11" x:Name="txtSearchMsg" Foreground="#FF6A6A6A"/>
107
                <telerik:RadProgressBar x:Name="searchIndicator" HorizontalAlignment="Right" Visibility="{Binding IsIndeterminate, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=searchIndicator}"
108
                                      telerik:StyleManager.Theme="Office2016" IsIndeterminate="False" />
109
            </StackPanel>
110
        </Grid>
111
        <!--Visibility="{Binding Instance.IsDownloadOriginal, Converter={StaticResource InvertedBooleanToVisibilityConverter}}"-->
112
        <Border Background="Black" Grid.RowSpan="2"  Opacity="0.7" Margin="-10" x:Name="border_Overlap"
113
                Visibility="Hidden"
114
                DataContext="{DynamicResource viewDataModel}">
115
            <StackPanel VerticalAlignment="Center">
116
                <TextBlock x:Name="tlDonwloadState" Text="원활한 검색을 위해 데이터를 준비합니다" Foreground="White" HorizontalAlignment="Center" Margin="0,10" FontWeight="Bold"/>
117
                <Button Content="다운로드" Margin="5" HorizontalAlignment="Center" Padding="10" Background="#FF0080FF" Foreground="White" BorderThickness="0"
118
                        x:Name="btnSearchPDFDownload" Visibility="Collapsed"/>
119
                <TextBlock x:Name="txtDownloadProgress"   Foreground="White" FontWeight="Bold"  HorizontalAlignment="Center" 
120
                           Text="{Binding Instance.DownloadFileProgress, StringFormat=Download File \{0\}%, ValidatesOnNotifyDataErrors=False}"
121
                           />
122
            </StackPanel>
123
        </Border>
124
    </Grid>
125
</UserControl>
클립보드 이미지 추가 (최대 크기: 500 MB)