Growl.xaml 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:hc="clr-namespace:HandyControl.Controls"
  3. xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
  4. <Style TargetType="hc:GrowlWindow">
  5. <Setter Property="hc:WindowAttach.IgnoreAltF4" Value="True"/>
  6. <Setter Property="hc:WindowAttach.ShowInTaskManager" Value="False"/>
  7. <Setter Property="Width" Value="340"/>
  8. <Setter Property="MaxWidth" Value="340"/>
  9. <Setter Property="Background" Value="Transparent"/>
  10. <Setter Property="ShowActivated" Value="False"/>
  11. <Setter Property="ShowInTaskbar" Value="False"/>
  12. <Setter Property="Topmost" Value="True"/>
  13. </Style>
  14. <Style TargetType="hc:Growl">
  15. <Setter Property="Focusable" Value="False"/>
  16. <Setter Property="MinHeight" Value="60"/>
  17. <Setter Property="Width" Value="320"/>
  18. <Setter Property="Margin" Value="10,10,10,0"/>
  19. <Setter Property="MaxWidth" Value="320"/>
  20. <Setter Property="hc:BorderElement.CornerRadius" Value="8"/>
  21. <Setter Property="Background" Value="{DynamicResource ThirdlyRegionBrush}"/>
  22. <Setter Property="Template">
  23. <Setter.Value>
  24. <ControlTemplate TargetType="hc:Growl">
  25. <Grid Name="PART_GridMain" RenderTransformOrigin="0.5,0.5">
  26. <Grid.RenderTransform>
  27. <TransformGroup>
  28. <TranslateTransform X="{TemplateBinding MaxWidth}"/>
  29. </TransformGroup>
  30. </Grid.RenderTransform>
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition Width="50"/>
  33. <ColumnDefinition/>
  34. <ColumnDefinition Width="Auto"/>
  35. </Grid.ColumnDefinitions>
  36. <Grid.RowDefinitions>
  37. <RowDefinition/>
  38. <RowDefinition Height="Auto"/>
  39. </Grid.RowDefinitions>
  40. <Border Grid.ColumnSpan="3" Grid.RowSpan="2" Effect="{StaticResource EffectShadow2}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"/>
  41. <Path FlowDirection="LeftToRight" Grid.Row="0" Grid.Column="0" VerticalAlignment="Top" Margin="0,15,0,0" Width="30" Height="30" Data="{TemplateBinding Icon}" Stretch="Uniform" Fill="{TemplateBinding IconBrush}"/>
  42. <StackPanel VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" Margin="0,10,10,10">
  43. <TextBlock Text="{TemplateBinding Message}" Style="{StaticResource TextBlockDefault}" HorizontalAlignment="Left" TextWrapping="Wrap"/>
  44. <TextBlock Visibility="{Binding ShowDateTime,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" Text="{Binding Time,RelativeSource={RelativeSource AncestorType=hc:Growl},StringFormat=yyyy/MM/dd HH:mm:ss}" Style="{StaticResource TextBlockDefault}" Foreground="{DynamicResource SecondaryTextBrush}" HorizontalAlignment="Left" Margin="0,4,0,0"/>
  45. </StackPanel>
  46. <Button Grid.Row="0" Visibility="Collapsed" Margin="11,0" Name="PART_ButtonClose" Command="interactivity:ControlCommands.Close" Grid.Column="2" Background="Transparent" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="18" Height="18">
  47. <Path FlowDirection="LeftToRight" Data="{StaticResource ErrorGeometry}" Stretch="Uniform" Fill="{DynamicResource SecondaryTextBrush}"/>
  48. </Button>
  49. <UniformGrid Columns="2" Name="PART_PanelMore" IsEnabled="False" Visibility="Collapsed" Grid.Row="1" Grid.ColumnSpan="3" Height="28" Grid.Column="0">
  50. <Button Command="interactivity:ControlCommands.Cancel" Style="{StaticResource ButtonCustom}" HorizontalAlignment="Stretch" Background="Transparent">
  51. <TextBlock Text="{Binding CancelStr,RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Center" Foreground="{DynamicResource DangerBrush}"/>
  52. </Button>
  53. <Button Command="interactivity:ControlCommands.Confirm" Style="{StaticResource ButtonCustom}" HorizontalAlignment="Stretch" Background="Transparent">
  54. <TextBlock Text="{Binding ConfirmStr,RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Center" Foreground="{DynamicResource PrimaryBrush}"/>
  55. </Button>
  56. </UniformGrid>
  57. </Grid>
  58. </ControlTemplate>
  59. </Setter.Value>
  60. </Setter>
  61. </Style>
  62. </ResourceDictionary>