Commit 3bc27535 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Started to add SIP message support

parent a0c000ec
......@@ -138,6 +138,7 @@ popd</Command>
<ClInclude Include="LinphoneCallLog.h" />
<ClInclude Include="LinphoneCallParams.h" />
<ClInclude Include="LinphoneCallStats.h" />
<ClInclude Include="LinphoneChatMessage.h" />
<ClInclude Include="LinphoneCoreFactory.h" />
<ClInclude Include="LinphoneAuthInfo.h" />
<ClInclude Include="LinphoneCore.h" />
......@@ -160,6 +161,7 @@ popd</Command>
<ClCompile Include="LinphoneCallLog.cpp" />
<ClCompile Include="LinphoneCallParams.cpp" />
<ClCompile Include="LinphoneCallStats.cpp" />
<ClCompile Include="LinphoneChatMessage.cpp" />
<ClCompile Include="LinphoneCore.cpp" />
<ClCompile Include="LinphoneCoreFactory.cpp" />
<ClCompile Include="LinphoneProxyConfig.cpp" />
......
......@@ -130,5 +130,16 @@ namespace Linphone
File = 2,
TCPRemote = 3
};
/// <summary>
/// Linphone chat message states
/// </summary>
public enum class LinphoneChatMessageState : int
{
Idle = 0,
InProgress = 1,
Delivered = 2,
NotDelivered = 3
};
}
}
\ No newline at end of file
#include "LinphoneChatMessage.h"
#include "LinphoneAddress.h"
#include "Server.h"
#include "Globals.h"
Platform::String^ Linphone::Core::LinphoneChatMessage::GetText()
{
return Linphone::Core::Utils::cctops(linphone_chat_message_get_text(this->message));
}
Linphone::Core::LinphoneAddress^ Linphone::Core::LinphoneChatMessage::GetPeerAddress()
{
return (Linphone::Core::LinphoneAddress^) Linphone::Core::Utils::CreateLinphoneAddress((void*)linphone_chat_message_get_peer_address(this->message));
}
Linphone::Core::LinphoneAddress^ Linphone::Core::LinphoneChatMessage::GetFrom()
{
return (Linphone::Core::LinphoneAddress^) Linphone::Core::Utils::CreateLinphoneAddress((void*)linphone_chat_message_get_from(this->message));
}
Platform::String^ Linphone::Core::LinphoneChatMessage::GetExternalBodyUrl()
{
return Linphone::Core::Utils::cctops(linphone_chat_message_get_external_body_url(this->message));
}
void Linphone::Core::LinphoneChatMessage::SetExternalBodyUrl(Platform::String^ url)
{
const char* body = Linphone::Core::Utils::pstoccs(url);
linphone_chat_message_set_external_body_url(this->message, body);
delete(body);
}
int64 Linphone::Core::LinphoneChatMessage::GetTime()
{
return linphone_chat_message_get_time(this->message) * 1000; // We need time in milliseconds.
}
Linphone::Core::LinphoneChatMessageState Linphone::Core::LinphoneChatMessage::GetState()
{
return (Linphone::Core::LinphoneChatMessageState) linphone_chat_message_get_state(this->message);
}
Linphone::Core::LinphoneChatMessage::LinphoneChatMessage(::LinphoneChatMessage *cm) :
message(cm)
{
RefToPtrProxy<LinphoneChatMessage^> *chat_message = new RefToPtrProxy<LinphoneChatMessage^>(this);
linphone_chat_message_set_user_data(this->message, chat_message);
}
Linphone::Core::LinphoneChatMessage::~LinphoneChatMessage()
{
RefToPtrProxy<LinphoneChatMessage^> *chat_message = reinterpret_cast< RefToPtrProxy<LinphoneChatMessage^> *>(linphone_chat_message_get_user_data(this->message));
delete chat_message;
}
\ No newline at end of file
#pragma once
#include "LinphoneCore.h"
#include "Enums.h"
namespace Linphone
{
namespace Core
{
ref class LinphoneCore;
/// <summary>
/// Represents a chat message shared between two users.
/// </summary>
public ref class LinphoneChatMessage sealed
{
public:
/// <summary>
/// Returns the text associated to this message.
/// </summary>
Platform::String^ GetText();
/// <summary>
/// Get peer address as LinphoneAddress associated to this message.
/// </summary>
Linphone::Core::LinphoneAddress^ GetPeerAddress();
/// <summary>
/// Get from address as LinphoneAddress associated to this message.
/// </summary>
Linphone::Core::LinphoneAddress^ GetFrom();
/// <summary>
/// Linphone message can carry external body as defined by rfc2017.
/// </summary>
Platform::String^ GetExternalBodyUrl();
/// <summary>
/// Linphone message can carry external body as defined by rfc2017.
/// </summary>
void SetExternalBodyUrl(Platform::String^ url);
/// <summary>
/// Gets the time at which the message was sent (in milliseconds since 01/01/1970).
/// </summary>
int64 GetTime();
/// <summary>
/// Gets the state of the message (Idle, InProgress, Delivered or NotDelivered).
/// </summary>
Linphone::Core::LinphoneChatMessageState GetState();
private:
friend class Linphone::Core::Utils;
friend ref class Linphone::Core::LinphoneCore;
LinphoneChatMessage(::LinphoneChatMessage *cm);
~LinphoneChatMessage();
::LinphoneChatMessage *message;
};
}
}
\ No newline at end of file
......@@ -1060,6 +1060,21 @@ void auth_info_requested(LinphoneCore *lc, const char *realm, const char *userna
}
}
void message_received(LinphoneCore *lc, LinphoneChatRoom* chat_room, LinphoneChatMessage* message)
{
Linphone::Core::LinphoneCoreListener^ listener = Linphone::Core::Globals::Instance->LinphoneCore->CoreListener;
if (listener != nullptr)
{
Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneChatMessage^> *proxy = reinterpret_cast< Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneChatMessage^> *>(linphone_chat_message_get_user_data(message));
Linphone::Core::LinphoneChatMessage^ lMessage = (proxy) ? proxy->Ref() : nullptr;
if (lMessage == nullptr) {
lMessage = (Linphone::Core::LinphoneChatMessage^)Linphone::Core::Utils::CreateLinphoneChatMessage(message);
}
listener->MessageReceived(lMessage);
}
}
Linphone::Core::LinphoneCore::LinphoneCore(LinphoneCoreListener^ coreListener) :
lc(nullptr),
listener(coreListener)
......@@ -1082,6 +1097,7 @@ void Linphone::Core::LinphoneCore::Init()
vtable->registration_state_changed = registration_state_changed;
vtable->call_state_changed = call_state_changed;
vtable->auth_info_requested = auth_info_requested;
vtable->message_received = message_received;
this->lc = linphone_core_new_with_config(vtable, config ? config->config : NULL, NULL);
......
......@@ -9,6 +9,7 @@ namespace Linphone
ref class LinphoneCall;
ref class LinphoneProxyConfig;
ref class LinphoneCallStats;
ref class LinphoneChatMessage;
public interface class LinphoneCoreListener
{
......@@ -28,6 +29,10 @@ namespace Linphone
void CallEncryptionChanged(LinphoneCall^ call, Platform::Boolean encrypted, Platform::String^ authenticationToken);
void CallStatsUpdated(LinphoneCall^ call, LinphoneCallStats^ stats);
void MessageReceived(LinphoneChatMessage^ message);
void MessageStateChanged(LinphoneChatMessage^ message, LinphoneChatMessageState state);
};
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
#include "LinphoneCallLog.h"
#include "LinphoneCallParams.h"
#include "LinphoneCallStats.h"
#include "LinphoneChatMessage.h"
#include "LpConfig.h"
#include "PayloadType.h"
......@@ -109,4 +110,9 @@ Platform::Object^ Linphone::Core::Utils::CreateLinphoneCallParams(void* callPara
Platform::Object^ Linphone::Core::Utils::CreateLinphoneCallStats(void* callStats, void* call)
{
return ref new Linphone::Core::LinphoneCallStats((::LinphoneCallStats *)callStats, (::LinphoneCall *)call);
}
\ No newline at end of file
}
Platform::Object^ Linphone::Core::Utils::CreateLinphoneChatMessage(void* message)
{
return ref new Linphone::Core::LinphoneChatMessage((::LinphoneChatMessage *)message);
}
\ No newline at end of file
......@@ -90,6 +90,11 @@ namespace Linphone
/// Creates a C++/CX LinphoneCallStats object using pointer to C structure.
/// </summary>
static Platform::Object^ CreateLinphoneCallStats(void* callStats, void* call);
/// <summary>
/// Creates a C++/CX LinphoneChatMessage object using pointer to C structure.
/// </summary>
static Platform::Object^ CreateLinphoneChatMessage(void* message);
private:
static std::string wstos(std::wstring ws);
......
......@@ -127,6 +127,9 @@ namespace Linphone
// We need to create a new channel.
httpChannel = new HttpNotificationChannel(App.pushChannelName);
httpChannel.Open();
// Bind this new channel for toast events.
httpChannel.BindToShellToast();
}
else
{
......
......@@ -112,6 +112,7 @@
<Compile Include="Model\CallLog.cs" />
<Compile Include="Model\ContactManager.cs" />
<Compile Include="Model\ContactPictureConverter.cs" />
<Compile Include="Model\Conversation.cs" />
<Compile Include="Model\HubTileConverterFix.cs" />
<Compile Include="Model\LinphoneManager.cs" />
<Compile Include="Model\Logger.cs" />
......@@ -137,6 +138,12 @@
<Compile Include="Views\AdvancedSettings.xaml.cs">
<DependentUpon>AdvancedSettings.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Chat.xaml.cs">
<DependentUpon>Chat.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Chats.xaml.cs">
<DependentUpon>Chats.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CodecsSettings.xaml.cs">
<DependentUpon>CodecsSettings.xaml</DependentUpon>
</Compile>
......@@ -163,6 +170,7 @@
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="Assets\AppBar\chat.png" />
<Content Include="Assets\AppBar\clear.png" />
<Content Include="Assets\AppBar\stats.png" />
<Content Include="Assets\linphonerc" />
......@@ -277,6 +285,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Chat.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Chats.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\CodecsSettings.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Linphone.Model
{
/// <summary>
/// Represents a message received or sent.
/// </summary>
public class ChatMessage
{
}
/// <summary>
/// Represents a chat conversation between the user and someone else.
/// </summary>
public class Conversation
{
/// <summary>
/// Display name of the remote contact.
/// </summary>
public string DisplayedName { get; set; }
/// <summary>
/// Latest message (can be troncated) received or sent.
/// </summary>
public string LatestMessage { get; set; }
/// <summary>
/// Date of the latest message received or sent.
/// </summary>
public string LatestMessageDate { get; set; }
/// <summary>
/// List of messages sent and received.
/// </summary>
public List<ChatMessage> Messages { get; set; }
/// <summary>
/// Public constructor.
/// </summary>
public Conversation(string displayName, List<ChatMessage> messages)
{
DisplayedName = displayName;
Messages = messages;
}
}
}
......@@ -3,6 +3,7 @@ using Linphone.Core;
using Linphone.Core.OutOfProcess;
using Microsoft.Phone.Net.NetworkInformation;
using Microsoft.Phone.Networking.Voip;
using Microsoft.Phone.Shell;
using System;
using System.Collections.Generic;
using System.Diagnostics;
......@@ -602,6 +603,28 @@ namespace Linphone.Model
public void CallStatsUpdated(LinphoneCall call, LinphoneCallStats stats)
{
}
/// <summary>
/// Callback for LinphoneCoreListener
/// </summary>
public void MessageReceived(LinphoneChatMessage message)
{
Logger.Msg("[LinphoneManager] Message received from " + message.GetFrom().AsStringUriOnly() + ": " + message.GetText());
//ShellToast toast = new ShellToast();
//toast.Content = message.GetText();
//toast.Title = message.GetFrom().GetDisplayName().Length > 0 ? message.GetFrom().GetDisplayName() : message.GetFrom().GetUserName();
//toast.NavigationUri = new Uri("/Views/Chat.xaml?sip=" + message.GetFrom().AsStringUriOnly(), UriKind.RelativeOrAbsolute);
//toast.Show();
}
/// <summary>
/// Callback for LinphoneCoreListener
/// </summary>
public void MessageStateChanged(LinphoneChatMessage message, LinphoneChatMessageState state)
{
}
#endregion
......
......@@ -62,6 +62,7 @@
<ActivatableClass ActivatableClassId="Linphone.Core.LinphoneCallLog" ThreadingModel="MTA" />
<ActivatableClass ActivatableClassId="Linphone.Core.LinphoneCallParams" ThreadingModel="MTA" />
<ActivatableClass ActivatableClassId="Linphone.Core.PayloadType" ThreadingModel="MTA" />
<ActivatableClass ActivatableClassId="Linphone.Core.LinphoneChatMessage" ThreadingModel="MTA" />
<ActivatableClass ActivatableClassId="Linphone.Core.LinphoneProxyConfig" ThreadingModel="MTA" />
<ActivatableClass ActivatableClassId="Linphone.Core.LpConfig" ThreadingModel="MTA" />
</InProcessServer>
......@@ -91,6 +92,7 @@
<Interface Name="Linphone.Core.__ILinphoneCallLogPublicNonVirtuals" InterfaceId="{F3C079C9-0A9C-3B02-A1CC-C61991D09E18}" />
<Interface Name="Linphone.Core.__ILinphoneCallParamsPublicNonVirtuals" InterfaceId="{26EFBF2D-6F46-35DE-9CFA-1A784C3C5A35}" />
<Interface Name="Linphone.Core.__IPayloadTypePublicNonVirtuals" InterfaceId="{BF73ED50-6AF0-3E18-9C7B-F81A8E91287B}" />
<Interface Name="Linphone.Core.__ILinphoneChatMessagePublicNonVirtuals" InterfaceId="{45DF6643-1744-3F81-8256-AF0ECEF6F6BC}" />
<Interface Name="Linphone.Core.__ILinphoneProxyConfigPublicNonVirtuals" InterfaceId="{FD2DF2D0-E760-354B-AD77-D0C81FBACE0B}" />
<Interface Name="Linphone.Core.__ILpConfigPublicNonVirtuals" InterfaceId="{3D421643-A4D5-370B-BA94-D03ED034EE76}" />
</ProxyStub>
......
......@@ -165,6 +165,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Chat.
/// </summary>
public static string ChatMenu {
get {
return ResourceManager.GetString("ChatMenu", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Codecs.
/// </summary>
......@@ -219,6 +228,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Conversations.
/// </summary>
public static string ConversationsMenu {
get {
return ResourceManager.GetString("ConversationsMenu", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Debug.
/// </summary>
......
......@@ -344,4 +344,10 @@ http://www.linphone.org/m/help
<data name="StatUploadBW" xml:space="preserve">
<value>Upload</value>
</data>
<data name="ChatMenu" xml:space="preserve">
<value>Chat</value>
</data>
<data name="ConversationsMenu" xml:space="preserve">
<value>Conversations</value>
</data>
</root>
\ No newline at end of file
<linphone:BasePage
x:Class="Linphone.Views.Chat"
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"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:linphone="clr-namespace:Linphone"
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-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
</Grid>
</Grid>
</linphone:BasePage>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
namespace Linphone.Views
{
public partial class Chat : BasePage
{
/// <summary>
/// Public constructor.
/// </summary>
public Chat()
{
InitializeComponent();
}
}
}
\ No newline at end of file
<linphone:BasePage
x:Class="Linphone.Views.Chats"
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"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:linphone="clr-namespace:Linphone"
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-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,5,0,0">
<!--<TextBlock Foreground="Black" Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>-->
<TextBlock Text="{Binding Path=LocalizedResources.ConversationsMenu, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,30,12,0">
<toolkit:LongListMultiSelector x:Name="Conversations" SelectionChanged="conversations_SelectionChanged_1">
<toolkit:LongListMultiSelector.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,-16,0,24"
Tag="{Binding BindsDirectlyToSource=True}"
Tap="conversation_Click_1">
<TextBlock Text="{Binding DisplayedName}"
Margin="0,0,0,-4"
HorizontalAlignment="Left"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
<TextBlock Text="{Binding LatestMessage}"
Margin="0,0,0,-4"
HorizontalAlignment="Left"
Foreground="{StaticResource PhoneSubtleBrush}"
FontSize="{StaticResource PhoneFontSizeNormal}"/>
</StackPanel>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemTemplate>
<toolkit:LongListMultiSelector.ItemInfoTemplate>
<DataTemplate>
<Border Width="30" Margin="5,0,5,0">
<TextBlock Text="{Binding LatestMessageDate}"
Margin="0,0,0,-4"
Foreground="{StaticResource PhoneSubtleBrush}"
FontSize="{StaticResource PhoneFontSizeSmall}"/>
</Border>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemInfoTemplate>
</toolkit:LongListMultiSelector>
</Grid>
</Grid>
</linphone:BasePage>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Linphone.Resources;
using Linphone.Model;
namespace Linphone.Views
{
/// <summary>
/// Displays the list of the previous conversations and permits to create new ones.
/// </summary>
public partial class Chats : BasePage
{
private bool _usingSelectionAppBar = false;
private IEnumerable<Conversation> _selection;
/// <summary>
/// Public constructor.
/// </summary>
public Chats()
{
InitializeComponent();
BuildLocalizedApplicationBar();
}
/// <summary>
/// Method called when the page is displayed.
/// Fetches the conversations from the LinphoneManager and displays them.
/// </summary>
/// <param name="e"></param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
//TODO
List<Conversation> conversations = new List<Conversation>();
conversations.Add(new Conversation("Barbara Shultz", null));
Conversations.ItemsSource = conversations;
}
private void BuildLocalizedApplicationBar()
{
ApplicationBar = new ApplicationBar();
SetupAppBarForEmptySelection();
}
private void ClearApplicationBar()
{
while (ApplicationBar.Buttons.Count > 0)
{
ApplicationBar.Buttons.RemoveAt(0);
}
}
private void deleteSelection_Click_1(object sender, EventArgs e)
{
ClearApplicationBar();
SetupAppBarForEmptySelection();
}
private void SetupAppBarForEmptySelection()
{
_usingSelectionAppBar = false;
}
private void SetupAppBarForSelectedItems()
{
ApplicationBarIconButton appBarDeleteSelection = new ApplicationBarIconButton(new Uri("/Assets/AppBar/delete.png", UriKind.Relative));
appBarDeleteSelection.Text = AppResources.DeleteSelectionMenu;
ApplicationBar.Buttons.Add(appBarDeleteSelection);
appBarDeleteSelection.Click += deleteSelection_Click_1;
_usingSelectionAppBar = true;
}
private void conversations_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{
LongListMultiSelector list = (LongListMultiSelector)sender;
if (list.SelectedItems.Count == 0)
{
ClearApplicationBar();
SetupAppBarForEmptySelection();
}
else if (list.SelectedItems.Count >= 1 && !_usingSelectionAppBar) // Do it only once, when selection was empty and isn't anymore
{
_selection = list.SelectedItems.Cast<Conversation>();
ClearApplicationBar();
SetupAppBarForSelectedItems();
}
}
private void conversation_Click_1(object sender, RoutedEventArgs e)
{
}
}
}
\ No newline at end of file
......@@ -79,6 +79,11 @@ namespace Linphone
addressBox.Text += "+";
}
private void chat_Click_1(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/Views/Chats.xaml", UriKind.RelativeOrAbsolute));
}
private void history_Click_1(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/Views/History.xaml", UriKind.RelativeOrAbsolute));
......@@ -108,6 +113,11 @@ namespace Linphone
{
ApplicationBar = new ApplicationBar();
ApplicationBarIconButton appBarChat = new ApplicationBarIconButton(new Uri("/Assets/AppBar/chat.png", UriKind.Relative));
appBarChat.Text = AppResources.ChatMenu;
ApplicationBar.Buttons.Add(appBarChat);
appBarChat.Click += chat_Click_1;
ApplicationBarIconButton appBarHistory = new ApplicationBarIconButton(new Uri("/Assets/AppBar/time.png", UriKind.Relative));
appBarHistory.Text = AppResources.HistoryMenu;
ApplicationBar.Buttons.Add(appBarHistory);
......
......@@ -24,19 +24,18 @@
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="1" Margin="12,5,0,0">
<StackPanel Grid.Row="0" Margin="12,5,0,0">
<!--<TextBlock Foreground="Black" Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>-->
<TextBlock Text="{Binding Path=LocalizedResources.HistoryMenu, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="2" Margin="12,10,12,0">
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,10,12,0">
<phone:Pivot>
<phone:PivotItem Header="{Binding Path=LocalizedResources.HistoryAll, Source={StaticResource LocalizedStrings}}">
<toolkit:LongListMultiSelector x:Name="Calls" SelectionChanged="calls_SelectionChanged_1">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment