Contacts.xaml 5.44 KB
Newer Older
1 2 3 4 5 6 7 8
<phone:PhoneApplicationPage
    x:Class="Linphone.Views.Contacts"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9
    xmlns:linphone="clr-namespace:Linphone.Model"
10 11 12 13 14 15 16 17
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
18
    <Grid x:Name="LayoutRoot" Background="Transparent">
19 20 21 22 23 24
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
25
        <StackPanel Grid.Row="0" Margin="12,5,0,0">
26
            <!--<TextBlock Foreground="Black" Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>-->
27
            <TextBlock Text="{Binding Path=LocalizedResources.ContactsMenu, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
28 29 30 31 32
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.Resources>
33
                <linphone:ContactPictureConverter x:Key="ContactPictureConverter"/>
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
                <phone:JumpListItemBackgroundConverter x:Key="BackgroundConverter"/>
                <phone:JumpListItemForegroundConverter x:Key="ForegroundConverter"/>
                <Style x:Key="ContactsJumpListStyle" TargetType="phone:LongListSelector">
                    <Setter Property="GridCellSize"  Value="113,113"/>
                    <Setter Property="LayoutMode" Value="Grid" />
                    <Setter Property="ItemTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <Border Background="{Binding Converter={StaticResource BackgroundConverter}}" Width="113" Height="113" Margin="6" >
                                    <TextBlock Text="{Binding Key}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" FontSize="48" Padding="6" 
                                        Foreground="{Binding Converter={StaticResource ForegroundConverter}}" VerticalAlignment="Center"/>
                                </Border>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Grid.Resources>
            
            <phone:LongListSelector
                x:Name="contactsList"
                IsGroupingEnabled="True"
                HideEmptyGroups="True"
                LayoutMode="List"
                JumpListStyle="{StaticResource ContactsJumpListStyle}"
58 59
                ItemsSource="{Binding}"
                SelectionChanged="contactsList_SelectionChanged_1">
60 61
                <phone:LongListSelector.GroupHeaderTemplate>
                    <DataTemplate>
62
                        <Border Background="Transparent" Padding="0, 0, 0, 5">
63 64 65 66
                            <Border 
                                Background="{StaticResource PhoneAccentBrush}" 
                                BorderBrush="{StaticResource PhoneAccentBrush}" 
                                BorderThickness="2" 
67 68
                                Width="72" 
                                Height="72" 
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
                                Margin="0,0,18,0" 
                                HorizontalAlignment="Left">
                                
                                <TextBlock 
                                    Text="{Binding Key}" 
                                    Foreground="{StaticResource PhoneForegroundBrush}" 
                                    FontSize="48" 
                                    Padding="6" 
                                    FontFamily="{StaticResource PhoneFontFamilySemiLight}" 
                                    HorizontalAlignment="Left" 
                                    VerticalAlignment="Center"/>
                                
                            </Border>
                        </Border>
                    </DataTemplate>
                </phone:LongListSelector.GroupHeaderTemplate>
                <phone:LongListSelector.ItemTemplate>
                    <DataTemplate>
87 88 89 90
                        <StackPanel Orientation="Horizontal" Margin="0, 5, 0, 5">
                            <Image Source="{Binding Converter={StaticResource ContactPictureConverter}}" Width="72" Height="72" Stretch="Fill" />
                            <TextBlock Text="{Binding DisplayName}" FontSize="35" Margin="10, 0, 0, 0"></TextBlock>
                        </StackPanel>
91 92 93 94 95 96 97
                    </DataTemplate>
                </phone:LongListSelector.ItemTemplate>
            </phone:LongListSelector>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>