History.xaml 5.24 KB
Newer Older
1 2 3 4 5 6 7 8 9
<Page
    x:Class="Linphone.Views.History"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:linphone="clr-namespace:Linphone"
    xmlns:controls="clr-namespace:Linphone.Controls"
    xmlns:model="using:Linphone.Model"
Margaux Clerc's avatar
Margaux Clerc committed
10
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
11 12 13 14 15 16 17 18 19 20 21 22
    mc:Ignorable="d">

    <Page.Resources>
        <model:BoolToAccentBrushConverter x:Key="BoolToAccentBrushConverter"/>

        <DataTemplate x:Name="CallLogListViewTemplate">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
23 24
                    <ColumnDefinition Width="15"/>
                    <ColumnDefinition Width="27.4"/>
25 26
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
27 28

                <Ellipse Width="32" Height="32" VerticalAlignment="Center" Grid.RowSpan="2" Margin="0,11,10.4,9" Grid.ColumnSpan="2">
29 30 31 32
                    <Ellipse.Fill>
                        <ImageBrush ImageSource="/Assets/avatar.png"/>
                    </Ellipse.Fill>
                </Ellipse>
33

34
                <TextBlock Grid.Column="1" Padding="0,5,0,0"
Margaux Clerc's avatar
Margaux Clerc committed
35
                            Text="{Binding DisplayedName}" 
36 37 38
                            Style="{StaticResource ListItemHeaderStyle}" Grid.ColumnSpan="2" Margin="27,0,-0.4,0.6"/>
                <TextBlock  Grid.Column="2" Padding="0,0,0,5"
                                Grid.Row="1" Style="{StaticResource ListItemStyle}" Foreground="{Binding IsMissed, Converter={StaticResource BoolToAccentBrushConverter}}" Height="22" Margin="0.6,0,-0.4,0" VerticalAlignment="Bottom">
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
                    <Run Text="{Binding StatusText}"></Run>
                    <Run Text=","></Run>
                    <Run Text="{Binding DetailsText}"></Run>
                </TextBlock>
            </Grid>
        </DataTemplate>
    </Page.Resources>

    <Grid x:Name="LayoutRoot" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

Margaux Clerc's avatar
Margaux Clerc committed
58 59 60 61
        <StackPanel Grid.Row="0" Margin="12,12,12,0">
            <TextBlock x:Uid="HistoryMenu" Text="HISTORY" Style="{StaticResource HeaderTextStyle}" />
        </StackPanel>

Margaux Clerc's avatar
Margaux Clerc committed
62 63 64 65 66 67 68 69
        <TextBlock 
            x:Name="EmptyText"
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            Visibility="Collapsed"
            Grid.Row="1"
            x:Uid="EmptyHistory"/>

70
        <Grid x:Name="ContentPanel" Grid.Row="1">
Erwan Croze's avatar
Erwan Croze committed
71 72
            <Pivot Tapped="headerList_Click_1">
                <PivotItem x:Uid="HistoryAll">
73 74 75 76 77 78
                    <ListView x:Name="Calls" 
                              Margin="-12,0,-12,0"
                              ItemsSource="{Binding}"
                              ItemTemplate="{StaticResource CallLogListViewTemplate}"
                              IsItemClickEnabled="True"
                              IsMultiSelectCheckBoxEnabled="True"
Erwan Croze's avatar
Erwan Croze committed
79
                              Tapped="itemList_Click_1"
80 81 82
                              ItemClick="Calls_ItemClick" UseLayoutRounding="True">
                    </ListView>
                </PivotItem>
83

84
                <PivotItem x:Uid="HistoryMissedTitle">
85 86
                    <ListView x:Name="MissedCalls"
                              Margin="-12,0,-12,0"
Erwan Croze's avatar
Erwan Croze committed
87
                              ItemsSource="{Binding}"
88
                              ItemTemplate="{StaticResource CallLogListViewTemplate}"
Erwan Croze's avatar
Erwan Croze committed
89 90
                              IsItemClickEnabled="True"
                              IsMultiSelectCheckBoxEnabled="True"
Erwan Croze's avatar
Erwan Croze committed
91
                              Tapped="itemList_Click_1"
Erwan Croze's avatar
Erwan Croze committed
92
                              ItemClick="Calls_ItemClick" UseLayoutRounding="True">
93 94 95 96 97 98
                    </ListView>
                </PivotItem>
            </Pivot>
        </Grid>

        <CommandBar Grid.Row="2" VerticalAlignment="Bottom" >
99 100 101 102 103 104 105
            <AppBarButton x:Name="SelectItems" FontFamily="OverflowCheckGlyph" x:Uid="SelectItem" Label="Select Items" Click="SelectItems_Click">
                <AppBarButton.Icon>
                    <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xe762;" />
                </AppBarButton.Icon>
            </AppBarButton>
            <AppBarButton Label="Delete" Icon="Delete" x:Uid="Delete" Click="DeleteItem_Click" x:Name="DeleteItem" />
            <AppBarButton Label="Cancel" Icon="Cancel" x:Uid="Cancel" Click="CancelBtn_Click" x:Name="CancelBtn"/>
106

107 108 109 110 111
            <CommandBar.SecondaryCommands>
                <AppBarButton x:Name="SelectAll" x:Uid="SelectAll"  Click="SelectAll_Click"/>
                <AppBarButton Visibility="Collapsed" x:Name="DeselectAll" x:Uid="DeselectAll"  Click="DeselectAll_Click"/>
            </CommandBar.SecondaryCommands>
        </CommandBar>
112 113
    </Grid>
</Page>