PageRenderTime 24ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/BookReader/BookReader/Resources/XAML/Common.xaml

#
XAML | 59 lines | 53 code | 4 blank | 2 comment | 0 complexity | 278d8740e9703e670f69cd89e6e4bf67 MD5 | raw file
 1<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 2    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 3    xmlns:ucc="clr-namespace:BookReader.Controls"
 4    >
 5
 6    <!-- Rectangle Style for Window borders and header -->
 7    <Style x:Key="RectangleFrame" TargetType="{x:Type Rectangle}">
 8        <Setter Property="RadiusX" Value="16"/>
 9        <Setter Property="RadiusY" Value="16"/>
10        <Setter Property="Opacity" Value="0.8"/>
11        <Setter Property="StrokeThickness" Value="0"/>
12        <Setter Property="HorizontalAlignment" Value="Stretch"/>
13        <Setter Property="VerticalAlignment" Value="Stretch"/>
14        <Setter Property="Fill" Value="{DynamicResource WindowBackgroundBrush}"/>
15        <Setter Property="BitmapEffect">
16            <Setter.Value>
17                <DropShadowBitmapEffect></DropShadowBitmapEffect>
18            </Setter.Value>
19        </Setter>    
20    </Style>
21
22    <!-- Header control-->
23    <Style x:Key="Header" TargetType="{x:Type ucc:Header}">
24        <Setter Property="HorizontalAlignment" Value="Stretch"/>
25        <Setter Property="VerticalContentAlignment" Value="Stretch"/>        
26        <Setter Property="Template">
27            <Setter.Value>
28                <ControlTemplate TargetType="{x:Type ucc:Header}">
29                    <Grid>
30                        <Grid.RowDefinitions>
31                            <RowDefinition Height="*" />
32                            <RowDefinition Height="*" />
33                            <RowDefinition Height="2" />
34                        </Grid.RowDefinitions>
35                        <Grid.ColumnDefinitions>
36                            <ColumnDefinition Width="60" />
37                            <ColumnDefinition Width="10" />
38                            <ColumnDefinition Width="*" />
39                        </Grid.ColumnDefinitions>
40                        <Rectangle Grid.ColumnSpan="3" Grid.RowSpan="2" RadiusX="16" RadiusY="16" Fill="{DynamicResource ShineBrush}" />
41                        <Image Grid.RowSpan="2" x:Name="imageHeaderCtrl" Margin="6" Source="{TemplateBinding Image}" />
42
43                        <TextBlock Grid.Column="2" x:Name="titleHeaderCtrl" FontWeight="Bold" Margin="0,0,0,1"
44			                Foreground="{DynamicResource TextBrush}" VerticalAlignment="Center" FontSize="15"
45                            Text="{TemplateBinding Title}"
46                            />
47
48                        <TextBlock Grid.Column="2" Grid.Row="1" x:Name="contentHeaderCtrl" 
49		                    Foreground="{DynamicResource TextBrush}" TextWrapping="Wrap" VerticalAlignment="Center"
50                            Text="{TemplateBinding Description}"
51                            />
52                        <Rectangle Grid.ColumnSpan="3" Grid.Row="2" VerticalAlignment="Stretch" 
53                                   Fill="{DynamicResource DefaultedBorderBrush}" Visibility="{TemplateBinding HasSeparator }"/>
54                    </Grid>
55                </ControlTemplate>
56            </Setter.Value>
57        </Setter>
58    </Style>
59</ResourceDictionary>