1: <DataTemplate x:Key="TableItemTemplate">
2: <DataTemplate.Resources>
3: <Storyboard x:Key="TableSelectedAnimation">
4: ...
5: </Storyboard>
6: <Storyboard x:Key="TableUnSelectedAnimation">
7: ...
8: </Storyboard>
9: </DataTemplate.Resources>
10: <Border x:Name="bd"
11: Width="{Binding Size.Width}"
12: Height="{Binding Size.Height}"
13: BorderBrush="White"
14: BorderThickness="5"
15: CornerRadius="20"
16: Background="#FF25F404"
17: RenderTransformOrigin="0.5,0.5">
18: <Border.RenderTransform>
19: <TransformGroup>
20: ...
21: </TransformGroup>
22: </Border.RenderTransform>
23: <Grid d:DesignWidth="260"
24: d:DesignHeight="197">
25: <Grid.RowDefinitions>
26: <RowDefinition Height="Auto"
27: MinHeight="56.057" />
28: <RowDefinition Height="Auto"
29: MinHeight="23.94" />
30: <RowDefinition Height="57.003" />
31: </Grid.RowDefinitions>
32: <TextBlock Text="{Binding ReservedBy}"
33: TextWrapping="Wrap"
34: VerticalAlignment="Stretch"
35: HorizontalAlignment="Center"
36: FontWeight="Bold"
37: FontSize="16"
38: TextTrimming="CharacterEllipsis"
39: TextAlignment="Center"
40: Foreground="White"
41: Grid.Row="1" />
42: <Grid Margin="0,10.293,0,10.294">
43: <TextBlock VerticalAlignment="Center"
44: RenderTransformOrigin="0.53,0.162"
45: FontSize="26.667"
46: FontWeight="Bold"
47: Foreground="Black"
48: Text="{Binding TableNumber, Mode=Default}"
49: TextAlignment="Center"
50: TextWrapping="Wrap"
51: Margin="0,0,0,3" />
52: <Ellipse Fill="{x:Null}"
53: Stroke="#FFEFEFEF"
54: StrokeThickness="3"
55: Margin="77,0" />
56: </Grid>
57: </Grid>
58: </Border>
59: <DataTemplate.Triggers>
60: <DataTrigger Binding="{Binding IsAvailable}"
61: Value="False">
62: <Setter TargetName="bd"
63: Property="Background"
64: Value="Red" />
65: </DataTrigger>
66: <DataTrigger Binding="{Binding IsSelected}"
67: Value="True">
68: <Setter TargetName="bd"
69: Value="Yellow"
70: Property="BorderBrush" />
71: <DataTrigger.EnterActions>
72: <BeginStoryboard Storyboard="{StaticResource TableSelectedAnimation }" />
73: </DataTrigger.EnterActions>
74: <DataTrigger.ExitActions>
75: <BeginStoryboard Storyboard="{StaticResource TableUnSelectedAnimation }" />
76: </DataTrigger.ExitActions>
77: </DataTrigger>
78: </DataTemplate.Triggers>
79: </DataTemplate>