2
0

InfoBox.xaml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <UserControl x:Class="InfoBox"
  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. mc:Ignorable="d"
  7. d:DesignHeight="300" d:DesignWidth="300" Width="230" Height="120" UseLayoutRounding="True">
  8. <Border x:Name="panBackAll">
  9. <Border.Background>
  10. <ImageBrush ImageSource="/pcl;component/Images/Infobox-Bg.png" />
  11. </Border.Background>
  12. <Grid Width="220" Height="110" Name="panBack" Background="{x:Null}">
  13. <Border BorderThickness="1" Width="222" Height="112" Margin="-1,-1,0,0">
  14. <Image Name="imgBack" Stretch="UniformToFill" HorizontalAlignment="Center" VerticalAlignment="Center" MinWidth="220" MinHeight="110">
  15. <Image.Effect>
  16. <BlurEffect x:Name="blur" Radius="4"/>
  17. </Image.Effect>
  18. </Image>
  19. <Border.BorderBrush>
  20. <SolidColorBrush />
  21. </Border.BorderBrush>
  22. </Border>
  23. <Grid Name="panInfo" Background="#1F000000">
  24. <Grid.Effect>
  25. <DropShadowEffect ShadowDepth="0" Opacity="0.85" BlurRadius="3"/>
  26. </Grid.Effect>
  27. <Label HorizontalAlignment="Left" Margin="38,0,0,65" Name="labTitle" Foreground="#FFFCFCFC" FontSize="13" Padding="2" Height="27" VerticalAlignment="Center" VerticalContentAlignment="Center" />
  28. <Path Fill="#FFFCFCFC" Height="20" Margin="12,12,0,0" Stretch="Fill" Width="20" HorizontalAlignment="Left" VerticalAlignment="Top" Name="path" />
  29. <TextBlock Name="labContent" Foreground="#FFFCFCFC" VerticalAlignment="Center" Padding="2" HorizontalAlignment="Center" MaxWidth="205" FontSize="14.5" Margin="0,25,0,0" TextWrapping="WrapWithOverflow" TextAlignment="Center" MaxHeight="72" />
  30. </Grid>
  31. </Grid>
  32. </Border>
  33. <UserControl.Triggers>
  34. <EventTrigger RoutedEvent="UIElement.MouseLeftButtonDown">
  35. <BeginStoryboard>
  36. <Storyboard>
  37. <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0.98" Duration="0:0:0.1" />
  38. <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0.98" Duration="0:0:0.1" />
  39. </Storyboard>
  40. </BeginStoryboard>
  41. </EventTrigger>
  42. <EventTrigger RoutedEvent="UIElement.MouseLeave">
  43. <BeginStoryboard>
  44. <Storyboard>
  45. <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="0:0:0.1" />
  46. <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="0:0:0.1" />
  47. </Storyboard>
  48. </BeginStoryboard>
  49. </EventTrigger>
  50. <EventTrigger RoutedEvent="UIElement.MouseLeftButtonUp">
  51. <BeginStoryboard>
  52. <Storyboard>
  53. <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="0:0:0.1" />
  54. <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="0:0:0.1" />
  55. </Storyboard>
  56. </BeginStoryboard>
  57. </EventTrigger>
  58. </UserControl.Triggers>
  59. <UserControl.RenderTransform>
  60. <ScaleTransform ScaleX="1" ScaleY="1" CenterX="115" CenterY="60"></ScaleTransform>
  61. </UserControl.RenderTransform>
  62. </UserControl>