1: <Page
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: xmlns:local="using:XPG.WinRTBehaviors"
5: xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6: xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7: xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
8: xmlns:Media="using:Microsoft.Xaml.Interactions.Media"
9: x:Class="XPG.WinRTBehaviors.MainPage"
10: x:Name="page" mc:Ignorable="d">
11:
12: <Page.DataContext>
13: <local:MainPageViewModel />
14: </Page.DataContext>
15:
16: <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
17: <Interactivity:Interaction.Behaviors>
18: <Core:DataTriggerBehavior Binding="{Binding Now.Second, Mode=OneWay}" ComparisonCondition="GreaterThanOrEqual" Value="0">
19: <Core:ChangePropertyAction TargetObject="{Binding ElementName=r9}" PropertyName="Visibility">
20: <Core:ChangePropertyAction.Value>
21: <Visibility>Visible</Visibility>
22: </Core:ChangePropertyAction.Value>
23: </Core:ChangePropertyAction>
24: </Core:DataTriggerBehavior>
25: <Core:DataTriggerBehavior Binding="{Binding Now.Second, Mode=OneWay}" ComparisonCondition="GreaterThanOrEqual" Value="6">
26: <Core:ChangePropertyAction TargetObject="{Binding ElementName=r8}" PropertyName="Visibility">
27: <Core:ChangePropertyAction.Value>
28: <Visibility>Visible</Visibility>
29: </Core:ChangePropertyAction.Value>
30: </Core:ChangePropertyAction>
31: </Core:DataTriggerBehavior>
32: <Core:DataTriggerBehavior Binding="{Binding Now.Second, Mode=OneWay}" ComparisonCondition="GreaterThanOrEqual" Value="12">
33: <Core:ChangePropertyAction TargetObject="{Binding ElementName=r7}" PropertyName="Visibility">
34: <Core:ChangePropertyAction.Value>
35: <Visibility>Visible</Visibility>
36: </Core:ChangePropertyAction.Value>
37: </Core:ChangePropertyAction>
38: </Core:DataTriggerBehavior>
39: <Core:DataTriggerBehavior Binding="{Binding Now.Second, Mode=OneWay}" ComparisonCondition="GreaterThanOrEqual" Value="18">
40: <Core:ChangePropertyAction TargetObject="{Binding ElementName=r6}" PropertyName="Visibility">
41: <Core:ChangePropertyAction.Value>
42: <Visibility>Visible</Visibility>
43: </Core:ChangePropertyAction.Value>
44: </Core:ChangePropertyAction>
45: </Core:DataTriggerBehavior>
46: <Core:DataTriggerBehavior Binding="{Binding Now.Second, Mode=OneWay}" ComparisonCondition="GreaterThanOrEqual" Value="24">
47: <Core:ChangePropertyAction TargetObject="{Binding ElementName=r5}" PropertyName="Visibility">
48: <Core:ChangePropertyAction.Value>
49: <Visibility>Visible</Visibility>
50: </Core:ChangePropertyAction.Value>
51: </Core:ChangePropertyAction>
52: </Core:DataTriggerBehavior>
53: <Core:DataTriggerBehavior Binding="{Binding Now.Second, Mode=OneWay}" ComparisonCondition="GreaterThanOrEqual" Value="30">
54: <Core:ChangePropertyAction TargetObject="{Binding ElementName=r4}" PropertyName="Visibility">
55: <Core:ChangePropertyAction.Value>
56: <Visibility>Visible</Visibility>
57: </Core:ChangePropertyAction.Value>
58: </Core:ChangePropertyAction>
59: </Core:DataTriggerBehavior>
60: <Core:DataTriggerBehavior Binding="{Binding Now.Second, Mode=OneWay}" ComparisonCondition="GreaterThanOrEqual" Value="36">
61: <Core:ChangePropertyAction TargetObject="{Binding ElementName=r3}" PropertyName="Visibility">
62: <Core:ChangePropertyAction.Value>
63: <Visibility>Visible</Visibility>
64: </Core:ChangePropertyAction.Value>
65: </Core:ChangePropertyAction>
66: </Core:DataTriggerBehavior>
67: <Core:DataTriggerBehavior Binding="{Binding Now.Second, Mode=OneWay}" ComparisonCondition="GreaterThan" Value="42">
68: <Core:ChangePropertyAction TargetObject="{Binding ElementName=r2}" PropertyName="Visibility">
69: <Core:ChangePropertyAction.Value>
70: <Visibility>Visible</Visibility>
71: </Core:ChangePropertyAction.Value>
72: </Core:ChangePropertyAction>
73: </Core:DataTriggerBehavior>
74: <Core:DataTriggerBehavior Binding="{Binding Now.Second, Mode=OneWay}" ComparisonCondition="GreaterThan" Value="48">
75: <Core:ChangePropertyAction TargetObject="{Binding ElementName=r1}" PropertyName="Visibility">
76: <Core:ChangePropertyAction.Value>
77: <Visibility>Visible</Visibility>
78: </Core:ChangePropertyAction.Value>
79: </Core:ChangePropertyAction>
80: </Core:DataTriggerBehavior>
81: </Interactivity:Interaction.Behaviors>
82: <Grid.ColumnDefinitions>
83: <ColumnDefinition/>
84: <ColumnDefinition/>
85: </Grid.ColumnDefinitions>
86: <StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" UseLayoutRounding="True">
87: <Rectangle x:Name="r1" Fill="#FF007D91" HorizontalAlignment="Center" Stroke="Black" VerticalAlignment="Center" Width="25" Height="25" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0" Visibility="Collapsed"/>
88: <Rectangle x:Name="r2" Fill="Blue" HorizontalAlignment="Center" Stroke="Black" VerticalAlignment="Center" Width="25" Height="25" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0" Visibility="Collapsed"/>
89: <Rectangle x:Name="r3" Fill="#FF6800FF" HorizontalAlignment="Center" Stroke="Black" VerticalAlignment="Center" Width="25" Height="25" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0" Visibility="Collapsed"/>
90: <Rectangle x:Name="r4" Fill="#FFE800FF" HorizontalAlignment="Center" Stroke="Black" VerticalAlignment="Center" Width="25" Height="25" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0" Visibility="Collapsed"/>
91: <Rectangle x:Name="r5" Fill="Red" HorizontalAlignment="Center" Stroke="Black" VerticalAlignment="Center" Width="25" Height="25" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0" Visibility="Collapsed"/>
92: <Rectangle x:Name="r6" Fill="#FFFF4600" HorizontalAlignment="Center" Stroke="Black" VerticalAlignment="Center" Width="25" Height="25" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0" Visibility="Collapsed"/>
93: <Rectangle x:Name="r7" Fill="#FFFF8B00" HorizontalAlignment="Center" Stroke="Black" VerticalAlignment="Center" Width="25" Height="25" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0" Visibility="Collapsed"/>
94: <Rectangle x:Name="r8" Fill="#FFF3FF00" HorizontalAlignment="Center" Stroke="Black" VerticalAlignment="Center" Width="25" Height="25" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0" Visibility="Collapsed"/>
95: <Rectangle x:Name="r9" Fill="White" HorizontalAlignment="Center" Stroke="Black" VerticalAlignment="Center" Width="25" Height="25" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0" Visibility="Collapsed"/>
96: </StackPanel>
97: <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Now.Second, Mode=OneWay}" FontSize="96" FontFamily="Consolas"/>
98: </Grid>
99: </Page>