프로젝트

일반

사용자정보

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

markus / KCOM / Controls / SearchPanel.xaml @ 6af42ff0

이력 | 보기 | 이력해설 | 다운로드 (8.37 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
                <telerik:RadMaskedTextInput Mask="" HorizontalAlignment="Stretch" Margin="2,0" AcceptsReturn="False" EmptyContent="Input Search Text" IsClearButtonVisible="True" Background="#FFF3F3F3" BorderThickness="0.5" VerticalContentAlignment="Center" x:Name="tbSearch"/>
32
                <Button Content="Search" Grid.Column="1" Padding="5" Background="#3d3d3d" Foreground="White" x:Name="btnSearch"/>
33
            </Grid>
34
            <GroupBox Header="Option List">
35
                <StackPanel Margin="1">
36
                    <CheckBox Content="Current page only" Margin="3" x:Name="chkCurrentPageOnly" IsChecked="False"/>
37
                </StackPanel>
38
            </GroupBox>
39
            <GroupBox Header="Search Mode">
40
                <StackPanel Margin="1">
41
                    <RadioButton GroupName="Search" Content="None - search as substring" IsChecked="True" Margin="3" Checked="chkSelectionChangeEvent"  Tag="0"/>
42
                    <RadioButton GroupName="Search" Content="Exact - search string as separate word" Margin="3" Checked="chkSelectionChangeEvent" Tag="1"/>
43
                    <RadioButton GroupName="Search" Content="Smart - find the word in various forms"  Margin="3" Checked="chkSelectionChangeEvent" Tag="2"/>
44
                </StackPanel>
45
                <!--<CheckBox Content="Match whole word" Margin="5"/>-->
46
            </GroupBox>
47

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