PageRenderTime 44ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 1ms

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