2014-06-23 14:22:14 +04:00
|
|
|
<Page
|
|
|
|
x:Class="ActivitiesExample.MainPage"
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:local="using:ActivitiesExample"
|
|
|
|
xmlns:converters="using:ActivitiesExample.Converters"
|
|
|
|
xmlns:data="using:ActivitiesExample.Data"
|
|
|
|
d:DataContext="{Binding Source={d:DesignInstance Type=data:MyDesignData, IsDesignTimeCreatable=True}}"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
mc:Ignorable="d"
|
|
|
|
Background="#FF1bA1E2">
|
2014-10-02 16:09:32 +04:00
|
|
|
|
2014-06-23 14:22:14 +04:00
|
|
|
<Page.Resources>
|
|
|
|
<converters:ElipsisVisible x:Key="VisibleElipsis"/>
|
|
|
|
<converters:TimeSpanToString x:Key="TimeToString"/>
|
|
|
|
<converters:TimeSpanToWidth x:Key="TimeToWidth"/>
|
|
|
|
<converters:ActivityToImage x:Key="ActivityToIcon"/>
|
|
|
|
<converters:ActivityToActivityHint x:Key="ActivityToHint"/>
|
2014-10-02 16:09:32 +04:00
|
|
|
<converters:TimeWindowToString x:Key="TimeWindowToString"/>
|
2014-06-23 14:22:14 +04:00
|
|
|
</Page.Resources>
|
2014-10-02 16:09:32 +04:00
|
|
|
|
2014-06-23 14:22:14 +04:00
|
|
|
<Grid>
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
</Grid.RowDefinitions>
|
2014-10-02 16:09:32 +04:00
|
|
|
|
2014-06-23 14:22:14 +04:00
|
|
|
<!--TitlePanel contains the name of the application and page title-->
|
|
|
|
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,24,0" >
|
|
|
|
<TextBlock x:Uid="ApplicationSuite" Text="_SensorCore Example" Style="{ThemeResource TitleTextBlockStyle}" Typography.Capitals="SmallCaps" Foreground="White"/>
|
|
|
|
<TextBlock x:Uid="ApplicationName" Text="_activities" Style="{ThemeResource HeaderTextBlockStyle}" Foreground="White"/>
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<!--ContentPanel - place additional content here-->
|
|
|
|
<Grid Grid.Row="1" Margin="0">
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
2014-10-15 17:16:47 +04:00
|
|
|
<RowDefinition Height="*"/>
|
2014-06-23 14:22:14 +04:00
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
</Grid.RowDefinitions>
|
2014-10-02 16:09:32 +04:00
|
|
|
|
2014-06-23 14:22:14 +04:00
|
|
|
<!-- current activity text -->
|
2014-10-15 17:16:47 +04:00
|
|
|
<StackPanel Grid.Row="0" Margin="24,24,0,24" VerticalAlignment="Center" HorizontalAlignment="Left">
|
2014-06-23 14:22:14 +04:00
|
|
|
<TextBlock x:Uid="CurrentActivityHeader" Text="_Current activity:" FontSize="{StaticResource TextStyleMediumFontSize}" VerticalAlignment="Center"/>
|
|
|
|
<TextBlock Text="{Binding Path=CurrentActivity, Mode=OneWay}" HorizontalAlignment="Left" FontSize="{StaticResource TextStyleExtraLargePlusFontSize}" Margin="12,0,0,0" VerticalAlignment="Center" />
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<!-- current activity icon -->
|
2014-10-07 13:46:59 +04:00
|
|
|
<Image Source="{Binding CurrentActivity, Converter={StaticResource ActivityToIcon}}" Grid.Row="2" Height="300" Width="300" Opacity="0.3"/>
|
2014-06-23 14:22:14 +04:00
|
|
|
|
|
|
|
<!-- List of activities -->
|
2014-10-02 16:09:32 +04:00
|
|
|
<TextBlock Text="{Binding Path=TimeWindow, Converter={StaticResource ResourceKey=TimeWindowToString}, Mode=OneWay}" Grid.Row="1" Margin="24,0,0,6" FontSize="{StaticResource TextStyleMediumFontSize}"/>
|
2014-10-15 17:16:47 +04:00
|
|
|
<ListView x:Name="ActivityListView" Grid.Row="2" Margin="24,0" ItemsSource="{Binding Path=ListData, Mode=OneWay}" Background="#3FFFFFFF" SelectionMode="None" MinHeight="310">
|
2014-06-23 14:22:14 +04:00
|
|
|
<ListView.ItemTemplate>
|
|
|
|
<DataTemplate>
|
2014-10-07 13:46:59 +04:00
|
|
|
<Grid Margin="0" Height="60" Width="{Binding ActualWidth, ElementName=ActivityListView, Mode=OneWay}">
|
2014-06-23 14:22:14 +04:00
|
|
|
<Grid.RowDefinitions >
|
2014-10-07 13:46:59 +04:00
|
|
|
<RowDefinition Height="10"/>
|
2014-06-23 14:22:14 +04:00
|
|
|
<RowDefinition Height="auto"/>
|
|
|
|
<RowDefinition Height="auto"/>
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.ColumnDefinitions>
|
2014-10-07 13:46:59 +04:00
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
<!-- 30px reserved for elipsis -->
|
2014-06-23 14:22:14 +04:00
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
2014-10-07 13:46:59 +04:00
|
|
|
<!-- Activity name and durations -->
|
|
|
|
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="12,0,0,0" >
|
2014-06-23 14:22:14 +04:00
|
|
|
<TextBlock Text="{Binding Path=ActivityName}" FontSize="{StaticResource TextStyleMediumFontSize}" Foreground="White" VerticalAlignment="Center"/>
|
|
|
|
<TextBlock Text="{Binding Path=ActivityTime, Converter={StaticResource ResourceKey=TimeToString}}" FontSize="{StaticResource TextStyleMediumFontSize}" Foreground="White" Margin="12,0,0,0" VerticalAlignment="Center"/>
|
|
|
|
</StackPanel>
|
2014-10-07 13:46:59 +04:00
|
|
|
<!-- Activity description -->
|
|
|
|
<TextBlock Grid.Row="2" Text="{Binding Path=ActivityName, Converter={StaticResource ResourceKey=ActivityToHint}}" FontSize="{StaticResource TextStyleSmallFontSize}" Foreground="White" VerticalAlignment="Center" Margin="12,1,12.667,5.833" Height="14"/>
|
|
|
|
<!-- Activity duration as a rectangle -->
|
|
|
|
<Rectangle Grid.Row="3" Grid.Column="0" Width="{Binding Path=ActivityTime, Converter={StaticResource ResourceKey=TimeToWidth}}" Height="6" Fill="White" VerticalAlignment="Top" HorizontalAlignment="Left"/>
|
|
|
|
<!-- Elipsis added to the end of rectangle if duration > 12h -->
|
|
|
|
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" Visibility="{Binding ActivityTime, Converter={StaticResource VisibleElipsis}}">
|
2014-06-23 14:22:14 +04:00
|
|
|
<Rectangle Margin="6,0,0,0" Width="6" Height="6" Fill="White" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
|
|
|
<Rectangle Margin="6,0,0,0" Width="6" Height="6" Fill="White" HorizontalAlignment="Right" VerticalAlignment="Top"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
</ListView>
|
2014-10-02 16:09:32 +04:00
|
|
|
|
2014-06-23 14:22:14 +04:00
|
|
|
<!-- x coordinates -->
|
2014-10-02 16:09:32 +04:00
|
|
|
<Grid Grid.Row="4" Margin="24,0,24,12" >
|
2014-06-23 14:22:14 +04:00
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="2*"/>
|
|
|
|
<ColumnDefinition Width="3*"/>
|
|
|
|
<ColumnDefinition Width="3*"/>
|
|
|
|
<ColumnDefinition Width="3*"/>
|
|
|
|
<ColumnDefinition Width="2*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="00h" Grid.Column="0" HorizontalAlignment="Left" FontSize="{StaticResource TextStyleMediumFontSize}"/>
|
|
|
|
<TextBlock Text="03h" Grid.Column="1" HorizontalAlignment="Center" FontSize="{StaticResource TextStyleMediumFontSize}"/>
|
|
|
|
<TextBlock Text="06h" Grid.Column="2" HorizontalAlignment="Center" FontSize="{StaticResource TextStyleMediumFontSize}"/>
|
|
|
|
<TextBlock Text="09h" Grid.Column="3" HorizontalAlignment="Center" FontSize="{StaticResource TextStyleMediumFontSize}"/>
|
|
|
|
<TextBlock Text="12h" Grid.Column="4" HorizontalAlignment="Right" FontSize="{StaticResource TextStyleMediumFontSize}"/>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<Page.BottomAppBar>
|
2014-10-02 16:09:32 +04:00
|
|
|
<CommandBar Opacity="0.5">
|
|
|
|
<AppBarButton x:Uid="PrevButton" x:Name="prevButton" Label="_previous" IsEnabled="True" Click="prevButton_Click" >
|
|
|
|
<AppBarButton.Icon>
|
|
|
|
<BitmapIcon UriSource="/Assets/back.png"/>
|
|
|
|
</AppBarButton.Icon>
|
|
|
|
</AppBarButton>
|
|
|
|
<AppBarButton x:Uid="RefreshButton" x:Name="refreshButton" Label="_refresh" IsEnabled="True" Click="RefreshButton_Click" >
|
|
|
|
<AppBarButton.Icon>
|
|
|
|
<BitmapIcon UriSource="/Assets/refresh.png"/>
|
|
|
|
</AppBarButton.Icon>
|
|
|
|
</AppBarButton>
|
|
|
|
<AppBarButton x:Uid="NextButton" x:Name="nextButton" Label="_next" IsEnabled="False" Click="nextButton_Click" >
|
|
|
|
<AppBarButton.Icon>
|
|
|
|
<BitmapIcon UriSource="/Assets/next.png"/>
|
|
|
|
</AppBarButton.Icon>
|
|
|
|
</AppBarButton>
|
2014-06-23 14:22:14 +04:00
|
|
|
<CommandBar.SecondaryCommands>
|
2014-10-02 16:09:32 +04:00
|
|
|
<!-- <AppBarButton x:Uid="Refresh" Label="_refresh _todays' _activities" Click="RefreshButton_Click"/> -->
|
2014-06-23 14:22:14 +04:00
|
|
|
<AppBarButton x:Uid="About" Label="_about" Click="AboutButton_Click"/>
|
|
|
|
</CommandBar.SecondaryCommands>
|
|
|
|
</CommandBar>
|
|
|
|
</Page.BottomAppBar>
|
2014-10-02 16:09:32 +04:00
|
|
|
|
2014-06-23 14:22:14 +04:00
|
|
|
</Page>
|