PageRenderTime 41ms CodeModel.GetById 34ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/BookReader/BookReader/Resources/XAML/DialogWindow.xaml

#
XAML | 80 lines | 56 code | 15 blank | 9 comment | 0 complexity | c46643f192e60df44d0233543288f667 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:ucd="clr-namespace:BookReader.Dialogs"
 4    xmlns:ucc="clr-namespace:BookReader.Controls"
 5    >
 6
 7    <!-- DialogWindow Style -->
 8    <Style x:Key="DialogWindow"  TargetType="{x:Type ucd:DialogWindow}">
 9        <Setter Property="SnapsToDevicePixels" Value="True"/>
10        <Setter Property="AllowsTransparency" Value="True"/>
11        <Setter Property="WindowStyle" Value="None"/>
12        <Setter Property="Background" Value="Transparent"/>
13        <Setter Property="ShowInTaskbar" Value="False"/>
14
15        <Setter Property="Template">
16            <Setter.Value>
17                <ControlTemplate TargetType="{x:Type ucd:DialogWindow}">
18
19                    <Grid Margin="10">
20                        <!--Windows Frame rectangle-->
21                        <Rectangle Style="{DynamicResource RectangleFrame}"/>
22
23                        <!--PART_Close is the dialog close button-->
24                        <Button Style="{DynamicResource closeButton}" x:Name="PART_Close" Height="11" 
25                                HorizontalAlignment="Right" Margin="0,9,11,0" VerticalAlignment="Top" Width="11" 
26                                ToolTip="Close" IsCancel="True"/>
27
28                        <!-- PART_ContentPresenter -->
29                        <ContentPresenter x:Name="PART_ContentPresenter"
30                                          HorizontalAlignment="Stretch"
31                                          VerticalAlignment="Stretch"
32                                          
33                                          />
34                    </Grid>
35
36                </ControlTemplate>
37            </Setter.Value>
38        </Setter>
39    </Style>
40
41    <!-- HeaderedDialogWindow Style -->
42    <Style x:Key="HeaderedDialogWindow" BasedOn="{StaticResource DialogWindow}" TargetType="{x:Type ucd:HeaderedDialogWindow}">
43        
44        <Setter Property="Template">
45            <Setter.Value>
46                <ControlTemplate TargetType="{x:Type ucd:HeaderedDialogWindow}">
47
48                    <Grid Margin="10">
49                        <Grid.RowDefinitions>
50                            <RowDefinition Height="80" />
51                            <RowDefinition Height="*" />
52                        </Grid.RowDefinitions>
53                        <!--Windows Frame rectangle-->
54                        <Rectangle Grid.RowSpan="2" Style="{DynamicResource RectangleFrame}"/>
55
56                        <!--Header-->
57                        <ucc:Header Style="{DynamicResource Header}" Grid.Row="0" x:Name="PART_Header"
58                                VerticalAlignment="Top" Height="70"
59                                Title="{TemplateBinding Property=Title}"
60                                Image="{TemplateBinding Property=DialogImage}"
61                                Description="{TemplateBinding Property=DialogDescription}" />
62                        
63                        <!--PART_Close is the dialog close button-->
64                        <Button Grid.Row="0" Style="{DynamicResource closeButton}" x:Name="PART_Close" Height="11" 
65                                HorizontalAlignment="Right" Margin="0,9,11,0" VerticalAlignment="Top" Width="11" 
66                                ToolTip="Close" IsCancel="True"/>
67
68                        <!-- PART_ContentPresenter -->
69                        <ContentPresenter Grid.Row="1" x:Name="PART_ContentPresenter"
70                                          HorizontalAlignment="Stretch"
71                                          VerticalAlignment="Stretch"
72                                          />
73                    </Grid>
74                    
75                </ControlTemplate>
76            </Setter.Value>
77        </Setter>
78    </Style>
79    
80</ResourceDictionary>