Commit 2498ce3b authored by Sylvain Berfini's avatar Sylvain Berfini

Improved size of elements based on screen size/resolution

parent 790d3465
This diff is collapsed.
......@@ -3,10 +3,13 @@
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:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:screenSizeSupport="clr-namespace:ScreenSizeSupport;assembly=ScreenSizeSupport">
<!--Application Resources-->
<Application.Resources>
<screenSizeSupport:DisplayInformationEmulator x:Key="DisplayInformationEmulator"/>
<local:LocalizedStrings xmlns:local="clr-namespace:Linphone" x:Key="LocalizedStrings"/>
<Style x:Key="AccentColorButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
......
......@@ -4,6 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:screenSizeSupport="clr-namespace:ScreenSizeSupport;assembly=ScreenSizeSupport"
xmlns:linphone="clr-namespace:Linphone.Controls"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
......@@ -15,7 +16,7 @@
<Style TargetType="RichTextBox" x:Key="MessageStyle">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Opacity" Value="0.8"/>
<Setter Property="Margin" Value="0,5,5,5"/>
<Setter Property="Margin" Value="0,0,5,3"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
</Style>
......@@ -28,66 +29,69 @@
</Style>
</UserControl.Resources>
<Grid Margin="5,0,100,5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<screenSizeSupport:ZoomBox
ZoomFactor="{Binding DisplayInformationEx.ViewPixelsPerHostPixel, Source={StaticResource DisplayInformationEmulator}}">
<Grid Margin="5,0,100,5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Path
Grid.Row="0"
Data="m 0,0 l 0,8 l 16,0 l -16,-16"
Fill="{StaticResource PhoneAccentBrush}"
Margin="10,10,0,-1"
HorizontalAlignment="Left"/>
<Path
Grid.Row="0"
Data="m 0,0 l 0,8 l 16,0 l -16,-16"
Fill="{StaticResource PhoneAccentBrush}"
Margin="10,10,0,-1"
HorizontalAlignment="Left"/>
<Rectangle Fill="{StaticResource PhoneAccentBrush}" Grid.RowSpan="2" Grid.Row="1"/>
<Rectangle Fill="{StaticResource PhoneAccentBrush}" Grid.RowSpan="2" Grid.Row="1"/>
<RichTextBox
Grid.Row="1"
x:Name="Message"
IsReadOnly="True"
Style="{StaticResource MessageStyle}"
TextAlignment="Left"/>
<RichTextBox
Grid.Row="1"
x:Name="Message"
IsReadOnly="True"
Style="{StaticResource MessageStyle}"
TextAlignment="Left"/>
<Button
Grid.Row="1"
x:Name="Download"
Visibility="Collapsed"
Click="DownloadImage_Click"
Foreground="White"
BorderBrush="White"
Content="{Binding Path=LocalizedResources.DownloadImage, Source={StaticResource LocalizedStrings}}"/>
<Button
Grid.Row="1"
x:Name="Download"
Visibility="Collapsed"
Click="DownloadImage_Click"
Foreground="White"
BorderBrush="White"
Content="{Binding Path=LocalizedResources.DownloadImage, Source={StaticResource LocalizedStrings}}"/>
<ProgressBar
Grid.Row="1"
Height="30"
Visibility="Collapsed"
x:Name="ProgressBar"
Foreground="White"
IsIndeterminate="True" />
<ProgressBar
Grid.Row="1"
Height="30"
Visibility="Collapsed"
x:Name="ProgressBar"
Foreground="White"
IsIndeterminate="True" />
<Image
Grid.Row="1"
Margin="5"
Tap="Image_Tap"
Stretch="UniformToFill"
Visibility="Collapsed"
x:Name="Image" />
<Image
Grid.Row="1"
Margin="5"
Tap="Image_Tap"
Stretch="UniformToFill"
Visibility="Collapsed"
x:Name="Image" />
<TextBlock
Grid.Row="2"
x:Name="Timestamp"
Style="{StaticResource TimestampStyle}"
TextAlignment="Right"/>
<TextBlock
Grid.Row="2"
x:Name="Timestamp"
Style="{StaticResource TimestampStyle}"
TextAlignment="Right"/>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsZoomEnabled="False">
<toolkit:MenuItem x:Name="Delete" Header="{Binding Path=LocalizedResources.ContextMenuDelete, Source={StaticResource LocalizedStrings}}" Click="Delete_Click"/>
<toolkit:MenuItem x:Name="Copy" Header="{Binding Path=LocalizedResources.ContextMenuCopy, Source={StaticResource LocalizedStrings}}" Click="Copy_Click"/>
<toolkit:MenuItem x:Name="Save" Header="{Binding Path=LocalizedResources.ContextMenuSave, Source={StaticResource LocalizedStrings}}" Click="Save_Click" Visibility="Collapsed"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</Grid>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsZoomEnabled="False">
<toolkit:MenuItem x:Name="Delete" Header="{Binding Path=LocalizedResources.ContextMenuDelete, Source={StaticResource LocalizedStrings}}" Click="Delete_Click"/>
<toolkit:MenuItem x:Name="Copy" Header="{Binding Path=LocalizedResources.ContextMenuCopy, Source={StaticResource LocalizedStrings}}" Click="Copy_Click"/>
<toolkit:MenuItem x:Name="Save" Header="{Binding Path=LocalizedResources.ContextMenuSave, Source={StaticResource LocalizedStrings}}" Click="Save_Click" Visibility="Collapsed"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</Grid>
</screenSizeSupport:ZoomBox>
</linphone:ChatBubble>
\ No newline at end of file
......@@ -4,6 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:screenSizeSupport="clr-namespace:ScreenSizeSupport;assembly=ScreenSizeSupport"
xmlns:linphone="clr-namespace:Linphone.Controls"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
......@@ -23,66 +24,69 @@
<Style TargetType="TextBlock" x:Key="TimestampStyle">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Opacity" Value="0.5"/>
<Setter Property="Margin" Value="0,5,5,0"/>
<Setter Property="Margin" Value="0,0,5,3"/>
<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeSmall}"/>
</Style>
</UserControl.Resources>
<Grid Margin="100,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle
x:Name="Background"
Fill="{StaticResource PhoneAccentBrush}"
Grid.RowSpan="2"/>
<screenSizeSupport:ZoomBox
ZoomFactor="{Binding DisplayInformationEx.ViewPixelsPerHostPixel, Source={StaticResource DisplayInformationEmulator}}">
<Grid Margin="100,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<RichTextBox
Grid.Row="0"
x:Name="Message"
IsReadOnly="True"
Style="{StaticResource MessageStyle}"
TextAlignment="Left"/>
<Rectangle
x:Name="Background"
Fill="{StaticResource PhoneAccentBrush}"
Grid.RowSpan="2"/>
<Image
Grid.Row="0"
Margin="5"
Stretch="UniformToFill"
Tap="Image_Tap"
x:Name="Image" />
<RichTextBox
Grid.Row="0"
x:Name="Message"
IsReadOnly="True"
Style="{StaticResource MessageStyle}"
TextAlignment="Left"/>
<StackPanel
Grid.Row="1"
Orientation="Horizontal"
HorizontalAlignment="Right">
<Image
x:Name="Status"
Source="/Assets/AppBar/next.png"
Height="25"
Stretch="Uniform"/>
<TextBlock
x:Name="Timestamp"
Style="{StaticResource TimestampStyle}"
TextAlignment="Right"/>
</StackPanel>
Grid.Row="0"
Margin="5"
Stretch="UniformToFill"
Tap="Image_Tap"
x:Name="Image" />
<Path
x:Name="Path"
Grid.Row="2"
Data="m 0,0 l 8,0 l 0,16 l -16,-16"
Fill="{StaticResource PhoneAccentBrush}"
Margin="0,-1,10,0"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="1"
Orientation="Horizontal"
HorizontalAlignment="Right">
<Image
x:Name="Status"
Source="/Assets/AppBar/next.png"
Height="25"
Stretch="Uniform"/>
<TextBlock
x:Name="Timestamp"
Style="{StaticResource TimestampStyle}"
TextAlignment="Right"/>
</StackPanel>
<Path
x:Name="Path"
Grid.Row="2"
Data="m 0,0 l 8,0 l 0,16 l -16,-16"
Fill="{StaticResource PhoneAccentBrush}"
Margin="0,-1,10,0"
HorizontalAlignment="Right"/>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsZoomEnabled="False">
<toolkit:MenuItem x:Name="Delete" Header="{Binding Path=LocalizedResources.ContextMenuDelete, Source={StaticResource LocalizedStrings}}" Click="Delete_Click"/>
<toolkit:MenuItem x:Name="Copy" Header="{Binding Path=LocalizedResources.ContextMenuCopy, Source={StaticResource LocalizedStrings}}" Click="Copy_Click"/>
<toolkit:MenuItem x:Name="Save" Header="{Binding Path=LocalizedResources.ContextMenuSave, Source={StaticResource LocalizedStrings}}" Click="Save_Click" Visibility="Collapsed"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</Grid>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsZoomEnabled="False">
<toolkit:MenuItem x:Name="Delete" Header="{Binding Path=LocalizedResources.ContextMenuDelete, Source={StaticResource LocalizedStrings}}" Click="Delete_Click"/>
<toolkit:MenuItem x:Name="Copy" Header="{Binding Path=LocalizedResources.ContextMenuCopy, Source={StaticResource LocalizedStrings}}" Click="Copy_Click"/>
<toolkit:MenuItem x:Name="Save" Header="{Binding Path=LocalizedResources.ContextMenuSave, Source={StaticResource LocalizedStrings}}" Click="Save_Click" Visibility="Collapsed"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</Grid>
</screenSizeSupport:ZoomBox>
</linphone:ChatBubble>
\ No newline at end of file
......@@ -4,6 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:screenSizeSupport="clr-namespace:ScreenSizeSupport;assembly=ScreenSizeSupport"
xmlns:linphone="clr-namespace:Linphone.Controls"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
......@@ -68,45 +69,47 @@
</Style>
</UserControl.Resources>
<Grid Margin="60,5,5,5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<screenSizeSupport:ZoomBox
ZoomFactor="{Binding DisplayInformationEx.ViewPixelsPerHostPixel, Source={StaticResource DisplayInformationEmulator}}">
<Grid Margin="60,5,5,5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle Fill="WhiteSmoke" Grid.RowSpan="2" Grid.Row="0"/>
<Rectangle Fill="WhiteSmoke" Grid.RowSpan="2" Grid.Row="0"/>
<Image
Grid.Row="0"
x:Name="Image"
Stretch="Uniform"
Margin="10"
Visibility="Collapsed">
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsZoomEnabled="False">
<toolkit:MenuItem x:Name="Delete" Header="{Binding Path=LocalizedResources.ContextMenuDelete, Source={StaticResource LocalizedStrings}}" Click="Delete_Click"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</Image>
<Image
Grid.Row="0"
x:Name="Image"
Stretch="Uniform"
Margin="10"
Visibility="Collapsed">
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsZoomEnabled="False">
<toolkit:MenuItem x:Name="Delete" Header="{Binding Path=LocalizedResources.ContextMenuDelete, Source={StaticResource LocalizedStrings}}" Click="Delete_Click"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</Image>
<TextBox
Grid.Row="1"
x:Name="Message"
TextChanged="Message_TextChanged"
InputScope="Chat"
TextAlignment="Left"
TextWrapping="Wrap"
AcceptsReturn="True"
Style="{StaticResource ChatTextBox}"/>
<TextBox
Grid.Row="1"
x:Name="Message"
TextChanged="Message_TextChanged"
InputScope="Chat"
TextAlignment="Left"
TextWrapping="Wrap"
AcceptsReturn="True"
Style="{StaticResource ChatTextBox}"/>
<Path
Grid.Row="2"
Data="m 0,0 l 8,0 l 0,16 l -16,-16"
Fill="WhiteSmoke"
Margin="0,-1,10,0"
HorizontalAlignment="Right"/>
</Grid>
<Path
Grid.Row="2"
Data="m 0,0 l 8,0 l 0,16 l -16,-16"
Fill="WhiteSmoke"
Margin="0,-1,10,0"
HorizontalAlignment="Right"/>
</Grid>
</screenSizeSupport:ZoomBox>
</linphone:ChatBubble>
\ No newline at end of file
......@@ -118,7 +118,7 @@
<Compile Include="Model\LinphoneManager.cs" />
<Compile Include="Model\Logger.cs" />
<Compile Include="Model\SipUriToUsernameConverter.cs" />
<Compile Include="Model\MissedToBrushConverter.cs" />
<Compile Include="Model\BoolToAccentBrushConverter.cs" />
<Compile Include="Model\SettingsManager.cs" />
<Compile Include="Model\InCallModel.cs" />
<Compile Include="Model\Utils.cs" />
......@@ -292,6 +292,10 @@
<Project>{C8D75245-FFCF-4932-A228-C9CC8BB60B03}</Project>
<Name>Core</Name>
</ProjectReference>
<ProjectReference Include="..\ScreenSizeSupport\ScreenSizeSupport.csproj">
<Project>{949a23fd-3917-495b-80fb-2465fe68b8a8}</Project>
<Name>ScreenSizeSupport</Name>
</ProjectReference>
<ProjectReference Include="..\submodules\mswp8vid\mswp8vid\mswp8vid.vcxproj">
<Project>{0565952A-EA62-46A2-8261-F5B4B490DA42}</Project>
<Name>libmswp8vid</Name>
......
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace Linphone.Model
{
/// <summary>
/// Converter returning the AccentColorBrush if the boolean is true, else returning a title color.
/// </summary>
public class MissedToBrushConverter : IValueConverter
{
/// <returns>A SolidColorBrush (PhoneAccentBrush or PhoneSubtleBrush).</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value)
{
return (SolidColorBrush)(Application.Current.Resources["PhoneAccentBrush"]);
}
else
{
return (SolidColorBrush)(Application.Current.Resources["PhoneSubtleBrush"]);
}
}
/// <summary>
/// Not implemented.
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace Linphone.Model
{
/// <summary>
/// Converter returning the AccentColorBrush if the boolean is true, else returning a title color.
/// </summary>
public class BoolToAccentBrushConverter : IValueConverter
{
/// <returns>A SolidColorBrush (PhoneAccentBrush or PhoneSubtleBrush).</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value)
{
return (SolidColorBrush)(Application.Current.Resources["PhoneAccentBrush"]);
}
else
{
return (SolidColorBrush)(Application.Current.Resources["PhoneSubtleBrush"]);
}
}
/// <summary>
/// Not implemented.
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
......@@ -7,6 +7,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:screenSizeSupport="clr-namespace:ScreenSizeSupport;assembly=ScreenSizeSupport"
xmlns:linphone="clr-namespace:Linphone"
xmlns:model="clr-namespace:Linphone.Model"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
......@@ -17,7 +18,7 @@
shell:SystemTray.IsVisible="True">
<linphone:BasePage.Resources>
<model:MissedToBrushConverter x:Key="MissedToBrushConverter"/>
<model:BoolToAccentBrushConverter x:Key="BoolToAccentBrushConverter"/>
<model:SipUriToUsernameConverter x:Key="SipUriToUsernameConverter"/>
</linphone:BasePage.Resources>
......@@ -39,27 +40,33 @@
<toolkit:LongListMultiSelector x:Name="Conversations" SelectionChanged="conversations_SelectionChanged_1">
<toolkit:LongListMultiSelector.ItemTemplate>
<DataTemplate>
<StackPanel
Margin="0,0,10,10"
Tag="{Binding BindsDirectlyToSource=True}"
Tap="conversation_Click_1">
<TextBlock Text="{Binding DisplayedName, Converter={StaticResource SipUriToUsernameConverter}}"
HorizontalAlignment="Left"
FontSize="{StaticResource PhoneFontSizeLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
<TextBlock Text="{Binding LatestMessage}"
HorizontalAlignment="Left"
TextWrapping="Wrap"
Foreground="{Binding IsLastMessageUnread, Converter={StaticResource MissedToBrushConverter}}"
FontSize="{StaticResource PhoneFontSizeSmall}"/>
</StackPanel>
<screenSizeSupport:ZoomBox
ZoomFactor="{Binding DisplayInformationEx.ViewPixelsPerHostPixel, Source={StaticResource DisplayInformationEmulator}}">
<StackPanel
Margin="0,0,10,10"
Tag="{Binding BindsDirectlyToSource=True}"
Tap="conversation_Click_1">
<TextBlock Text="{Binding DisplayedName, Converter={StaticResource SipUriToUsernameConverter}}"
HorizontalAlignment="Left"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
<TextBlock Text="{Binding LatestMessage}"
HorizontalAlignment="Left"
TextWrapping="Wrap"
Foreground="{Binding IsLastMessageUnread, Converter={StaticResource BoolToAccentBrushConverter}}"
FontSize="{StaticResource PhoneFontSizeMediumLarge}"/>
</StackPanel>
</screenSizeSupport:ZoomBox>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemTemplate>
<toolkit:LongListMultiSelector.ItemInfoTemplate>
<DataTemplate>
<TextBlock Text="{Binding LatestMessageDate}"
Margin="0,20,0,0"
FontSize="{StaticResource PhoneFontSizeSmall}"/>
<screenSizeSupport:ZoomBox
ZoomFactor="{Binding DisplayInformationEx.ViewPixelsPerHostPixel, Source={StaticResource DisplayInformationEmulator}}">
<TextBlock Text="{Binding LatestMessageDate}"
Margin="0,20,0,0"
FontSize="{StaticResource PhoneFontSizeMediumLarge}"/>
</screenSizeSupport:ZoomBox>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemInfoTemplate>
</toolkit:LongListMultiSelector>
......
......@@ -40,7 +40,7 @@
<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"
<TextBlock Text="{Binding Key}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" FontSize="{StaticResource PhoneFontSizeExtraLarge}" Padding="6"
Foreground="{Binding Converter={StaticResource ForegroundConverter}}" VerticalAlignment="Center"/>
</Border>
</DataTemplate>
......@@ -235,7 +235,7 @@
<TextBlock
Text="{Binding Key}"
Foreground="{StaticResource PhoneForegroundBrush}"
FontSize="48"
FontSize="{StaticResource PhoneFontSizeExtraExtraLarge}"
Padding="6"
FontFamily="{StaticResource PhoneFontFamilySemiLight}"
HorizontalAlignment="Left"
......@@ -248,7 +248,7 @@
<DataTemplate>
<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>
<TextBlock Text="{Binding DisplayName}" FontSize="{StaticResource PhoneFontSizeLarge}" Margin="10,0,0,0"></TextBlock>
</StackPanel>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
......
......@@ -7,6 +7,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:screenSizeSupport="clr-namespace:ScreenSizeSupport;assembly=ScreenSizeSupport"
xmlns:linphone="clr-namespace:Linphone"
xmlns:controls="clr-namespace:Linphone.Controls"
xmlns:model="clr-namespace:Linphone.Model"
......@@ -18,7 +19,7 @@
shell:SystemTray.IsVisible="True">
<linphone:BasePage.Resources>
<model:MissedToBrushConverter x:Key="MissedToBrushConverter"/>
<model:BoolToAccentBrushConverter x:Key="BoolToAccentBrushConverter"/>
<model:SipUriToUsernameConverter x:Key="SipUriToUsernameConverter"/>
</linphone:BasePage.Resources>
......@@ -36,27 +37,31 @@
<toolkit:LongListMultiSelector x:Name="Calls" SelectionChanged="calls_SelectionChanged_1">
<toolkit:LongListMultiSelector.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,-16,0,24"
Tag="{Binding BindsDirectlyToSource=True}"
Tap="callLog_Click_1">
<TextBlock Text="{Binding DisplayedName, Converter={StaticResource SipUriToUsernameConverter}}"
Margin="0,0,0,-4"
HorizontalAlignment="Left"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
<TextBlock Text="{Binding StatusText}"
Margin="0,0,0,-4"
HorizontalAlignment="Left"
Foreground="{Binding IsMissed, Converter={StaticResource MissedToBrushConverter}}"
FontSize="{StaticResource PhoneFontSizeNormal}"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
<TextBlock Text="{Binding DetailsText}"
HorizontalAlignment="Left"
Foreground="{StaticResource PhoneSubtleBrush}"
FontSize="{StaticResource PhoneFontSizeNormal}"/>
</StackPanel>
<screenSizeSupport:ZoomBox
ZoomFactor="{Binding DisplayInformationEx.ViewPixelsPerHostPixel, Source={StaticResource DisplayInformationEmulator}}">
<StackPanel Margin="0,0,0,10"
Tag="{Binding BindsDirectlyToSource=True}"
Tap="callLog_Click_1">
<TextBlock Text="{Binding DisplayedName, Converter={StaticResource SipUriToUsernameConverter}}"
HorizontalAlignment="Left"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
<TextBlock Text="{Binding StatusText}"
HorizontalAlignment="Left"
Foreground="{Binding IsMissed, Converter={StaticResource BoolToAccentBrushConverter}}"
FontSize="{StaticResource PhoneFontSizeMediumLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
</StackPanel>
</screenSizeSupport:ZoomBox>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemTemplate>
<toolkit:LongListMultiSelector.ItemInfoTemplate>
<DataTemplate>
<TextBlock Text="{Binding DetailsText}"
Margin="0,20,0,0"
FontSize="{StaticResource PhoneFontSizeMediumLarge}"/>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemInfoTemplate>
</toolkit:LongListMultiSelector>
</phone:PivotItem>
......@@ -64,27 +69,31 @@
<toolkit:LongListMultiSelector x:Name="MissedCalls" SelectionChanged="calls_SelectionChanged_1">
<toolkit:LongListMultiSelector.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,-16,0,24"
Tag="{Binding BindsDirectlyToSource=True}"
Tap="callLog_Click_1">
<TextBlock Text="{Binding DisplayedName, Converter={StaticResource SipUriToUsernameConverter}}"
Margin="0,0,0,-4"
HorizontalAlignment="Left"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
<TextBlock Text="{Binding StatusText}"
Margin="0,0,0,-4"
HorizontalAlignment="Left"
Foreground="{Binding IsMissed, Converter={StaticResource MissedToBrushConverter}}"
FontSize="{StaticResource PhoneFontSizeNormal}"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
<TextBlock Text="{Binding DetailsText}"
HorizontalAlignment="Left"
Foreground="{StaticResource PhoneSubtleBrush}"
FontSize="{StaticResource PhoneFontSizeNormal}"/>
</StackPanel>
<screenSizeSupport:ZoomBox
ZoomFactor="{Binding DisplayInformationEx.ViewPixelsPerHostPixel, Source={StaticResource DisplayInformationEmulator}}">
<StackPanel Margin="0,0,0,10"
Tag="{Binding BindsDirectlyToSource=True}"
Tap="callLog_Click_1">
<TextBlock Text="{Binding DisplayedName, Converter={StaticResource SipUriToUsernameConverter}}"
HorizontalAlignment="Left"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
<TextBlock Text="{Binding StatusText}"
HorizontalAlignment="Left"
Foreground="{Binding IsMissed, Converter={StaticResource BoolToAccentBrushConverter}}"
FontSize="{StaticResource PhoneFontSizeMediumLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
</StackPanel>
</screenSizeSupport:ZoomBox>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemTemplate>
<toolkit:LongListMultiSelector.ItemInfoTemplate>
<DataTemplate>
<TextBlock Text="{Binding DetailsText}"
Margin="0,20,0,0"
FontSize="{StaticResource PhoneFontSizeMediumLarge}"/>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemInfoTemplate>
</toolkit:LongListMultiSelector>
</phone:PivotItem>
</phone:Pivot>
......
using ScreenSizeSupport.Misc;
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace ScreenSizeSupport
{
public class DisplayInformationEmulator : INotifyPropertyChanged
{
DisplayInformationEx displayInformationEx;
public DisplayInformationEx DisplayInformationEx
{
get { return displayInformationEx; }
set { displayInformationEx = value; RaisePropertyChanged(); RaiseDisplayInformationExChanged(); }
}
private ScreenInfo screenInfo;
[TypeConverter(typeof(StringToScreenInfoConverter))]
public ScreenInfo EmulatedScreenInfo
{
get { return screenInfo; }
set
{
screenInfo = value;
DisplayInformationEx = new DisplayInformationEx(screenInfo.PhysicalSize, screenInfo.PhysicalResolution);
RaisePropertyChanged();
}
}
public DisplayInformationEmulator()
{
DisplayInformationEx = DisplayInformationEx.Default;
}
void RaisePropertyChanged([CallerMemberName] string property = "")
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(property));
}
void RaiseDisplayInformationExChanged()
{
var handler = DisplayInformationExChanged;
if (handler != null)
handler(this, EventArgs.Empty);
}
public event PropertyChangedEventHandler PropertyChanged;
public event EventHandler DisplayInformationExChanged;
}
}
using Microsoft.Phone.Info;
using ScreenSizeSupport.Misc;
using System;
using System.ComponentModel;
using System.Windows;