-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
44 lines (44 loc) · 3.31 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" WindowStartupLocation="CenterScreen" Width="500" Height="500">
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid Width="400">
<Border x:Name="border" BorderThickness="0.5" BorderBrush="Black" Background="#FF252525">
<Border.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="1.1" Duration="0:0:0.3" Storyboard.TargetName="image" Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)"/>
<DoubleAnimation To="1.1" Duration="0:0:0.3" Storyboard.TargetName="image" Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="1" Duration="0:0:0.3" Storyboard.TargetName="image" Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)"/>
<DoubleAnimation To="1" Duration="0:0:0.3" Storyboard.TargetName="image" Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Border.Triggers>
<StackPanel>
<Grid Height="224" ClipToBounds="True">
<Image x:Name="image" Source="Assets/maxresdefault.jpg" Stretch="Uniform" RenderTransformOrigin="0.5,0.5" Height="224">
<Image.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1"/>
</Image.RenderTransform>
</Image>
</Grid>
<Grid Margin="15,10,15,10">
<StackPanel>
<TextBlock Text="News Title" Foreground="#FFffc107" FontWeight="Bold" FontSize="14"/>
<TextBlock Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id odio nec dui eleifend viverra vitae ac tellus. Duis dapibus in nunc nec volutpat. Duis vehicula, ante eu posuere auctor, ex quam venenatis neque, eget ultrices lorem dolor et leo. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus sed dolor imperdiet nisl congue porttitor quis ut orci. Cras efficitur suscipit ipsum non dictum. Ut et justo vel libero congue vulputate sagittis et ante. Nullam et sapien id sem condimentum ornare eget sed odio. Etiam vitae ornare lacus. Nam viverra mauris porttitor ante posuere, eget porta odio tristique." Foreground="White" Margin="0,5,0,0" TextWrapping="Wrap" TextTrimming="CharacterEllipsis"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
</Grid>
</Grid>
</Window>