|
|
|
|
@ -1,33 +1,78 @@
|
|
|
|
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
|
|
|
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
|
|
|
x:Class="BookAStar.Pages.ChatPage"
|
|
|
|
|
xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar"
|
|
|
|
|
xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
|
|
|
x:Class="BookAStar.Pages.ChatPage"
|
|
|
|
|
xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar"
|
|
|
|
|
xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
|
|
|
|
|
xmlns:toolkit="clr-namespace:XLabs.Forms.Mvvm;assembly=XLabs.Forms"
|
|
|
|
|
xmlns:converters="clr-namespace:BookAStar.Converters;assembly=BookAStar"
|
|
|
|
|
xmlns:local="clr-namespace:BookAStar;Assembly:BookAStar"
|
|
|
|
|
xmlns:extensions="clr-namespace:BookAStar.Extensions;assembly=BookAStar"
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<TabbedPage.Resources>
|
|
|
|
|
<ResourceDictionary>
|
|
|
|
|
<converters:SignalRConnectionStateToObject x:Key="cxToStyleImage" x:TypeArguments="Style">
|
|
|
|
|
|
|
|
|
|
<converters:SignalRConnectionStateToObject.DisconnectedObject>
|
|
|
|
|
<Style TargetType="Image">
|
|
|
|
|
<Setter Property="Source"
|
|
|
|
|
Value="{extensions:ImageResource BookAStar.Images.Chat.disconnected.png}" />
|
|
|
|
|
</Style>
|
|
|
|
|
</converters:SignalRConnectionStateToObject.DisconnectedObject>
|
|
|
|
|
|
|
|
|
|
<converters:SignalRConnectionStateToObject.ConnectedObject>
|
|
|
|
|
<Style TargetType="Image">
|
|
|
|
|
<Setter Property="Source"
|
|
|
|
|
Value="{extensions:ImageResource BookAStar.Images.Chat.connected.png}" />
|
|
|
|
|
</Style>
|
|
|
|
|
</converters:SignalRConnectionStateToObject.ConnectedObject>
|
|
|
|
|
|
|
|
|
|
<converters:SignalRConnectionStateToObject.ConnectingObject>
|
|
|
|
|
<Style TargetType="Image">
|
|
|
|
|
<Setter Property="Source"
|
|
|
|
|
Value="{extensions:ImageResource BookAStar.Images.Chat.connecting.png}" />
|
|
|
|
|
</Style>
|
|
|
|
|
</converters:SignalRConnectionStateToObject.ConnectingObject>
|
|
|
|
|
|
|
|
|
|
<converters:SignalRConnectionStateToObject.ReconnectingObject>
|
|
|
|
|
<Style TargetType="Image">
|
|
|
|
|
<Setter Property="Source"
|
|
|
|
|
Value="{extensions:ImageResource BookAStar.Images.Chat.reconnecting.png}" />
|
|
|
|
|
</Style>
|
|
|
|
|
</converters:SignalRConnectionStateToObject.ReconnectingObject>
|
|
|
|
|
</converters:SignalRConnectionStateToObject>
|
|
|
|
|
</ResourceDictionary>
|
|
|
|
|
</TabbedPage.Resources>
|
|
|
|
|
<TabbedPage.Children>
|
|
|
|
|
<ContentPage Title="Public" Icon="chat_icon_s.png" >
|
|
|
|
|
<StackLayout Padding="5, 5, 5, 5">
|
|
|
|
|
<StackLayout Spacing = "12"
|
|
|
|
|
Orientation = "Horizontal"
|
|
|
|
|
Padding="5, 0, 5, 0">
|
|
|
|
|
<Image
|
|
|
|
|
x:Name="reconnectImage"
|
|
|
|
|
Style="{Binding Source={x:Static local:App.ChatHubConnection},
|
|
|
|
|
Path=State,
|
|
|
|
|
Converter={StaticResource cxToStyleImage}}" />
|
|
|
|
|
<Entry x:Name="messageEntry" Placeholder = "enter your Message"
|
|
|
|
|
VerticalOptions = "Center"
|
|
|
|
|
VerticalOptions = "Center"
|
|
|
|
|
HorizontalOptions = "FillAndExpand"></Entry>
|
|
|
|
|
<Button x:Name="sendButton" Text = "Send" HorizontalOptions = "End"
|
|
|
|
|
VerticalOptions = "Center"></Button>
|
|
|
|
|
</StackLayout>
|
|
|
|
|
<ListView x:Name="messageList" HasUnevenRows="true">
|
|
|
|
|
<ListView x:Name="messageList" HasUnevenRows="true"
|
|
|
|
|
>
|
|
|
|
|
<ListView.ItemTemplate HeightRequest="80" VerticalOptions="StartAndExpand">
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<ViewCell>
|
|
|
|
|
<ViewCell.View>
|
|
|
|
|
<StackLayout Orientation="Horizontal" VerticalOptions="StartAndExpand">
|
|
|
|
|
<Label Text="{Binding Date, StringFormat='{0:HH:mm}'}" FontAttributes="Italic" />
|
|
|
|
|
<Label Text="{Binding SenderId}" FontFamily="monospace" FontAttributes="Italic" />
|
|
|
|
|
<BoxView WidthRequest="1" HeightRequest="15" Color="#000090"/>
|
|
|
|
|
<Label Text="{Binding Message}" FontFamily="monospace" />
|
|
|
|
|
<Label Text="{Binding Date, StringFormat='{0:HH:mm}'}" FontAttributes="Italic" />
|
|
|
|
|
<Label Text="{Binding SenderId}" FontFamily="monospace" FontAttributes="Italic" />
|
|
|
|
|
<BoxView WidthRequest="1" HeightRequest="15" Color="#000090"/>
|
|
|
|
|
<Label Text="{Binding Message}" FontFamily="monospace" />
|
|
|
|
|
</StackLayout>
|
|
|
|
|
</ViewCell.View>
|
|
|
|
|
</ViewCell>
|
|
|
|
|
@ -36,61 +81,62 @@
|
|
|
|
|
</ListView>
|
|
|
|
|
</StackLayout>
|
|
|
|
|
</ContentPage>
|
|
|
|
|
<ContentPage Title="Notifications" Icon="exclam.png" >
|
|
|
|
|
<StackLayout Padding="5, 5, 5, 5">
|
|
|
|
|
<ListView x:Name="notifList" HasUnevenRows="true">
|
|
|
|
|
<ContentPage Title="Notifications" Icon="exclam.png" >
|
|
|
|
|
<StackLayout Padding="5, 5, 5, 5">
|
|
|
|
|
<ListView x:Name="notifList" HasUnevenRows="true">
|
|
|
|
|
<ListView.ItemTemplate HeightRequest="80" VerticalOptions="StartAndExpand">
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<ViewCell>
|
|
|
|
|
<ViewCell.View>
|
|
|
|
|
<StackLayout Orientation="Horizontal" VerticalOptions="StartAndExpand">
|
|
|
|
|
<Label Text="{Binding Date, StringFormat='{0:hh:mm}'}" FontAttributes="Italic" />
|
|
|
|
|
<Label Text="{Binding SenderId}" FontFamily="monospace" FontAttributes="Italic" />
|
|
|
|
|
<BoxView Color="#000090" WidthRequest="1" HeightRequest="15" />
|
|
|
|
|
<Label Text="{Binding Message}" FontFamily="monospace" />
|
|
|
|
|
<Label Text="{Binding Date, StringFormat='{0:hh:mm}'}" FontAttributes="Italic" />
|
|
|
|
|
<Label Text="{Binding SenderId}" FontFamily="monospace" FontAttributes="Italic" />
|
|
|
|
|
<BoxView Color="#000090" WidthRequest="1" HeightRequest="15" />
|
|
|
|
|
<Label Text="{Binding Message}" FontFamily="monospace" />
|
|
|
|
|
</StackLayout>
|
|
|
|
|
</ViewCell.View>
|
|
|
|
|
</ViewCell>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
</ListView>
|
|
|
|
|
</StackLayout>
|
|
|
|
|
</StackLayout>
|
|
|
|
|
</ContentPage>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ContentPage Title="Contacts" Icon="peer_to_peer.png" >
|
|
|
|
|
<StackLayout Padding="5, 5, 5, 5">
|
|
|
|
|
<StackLayout Spacing = "12"
|
|
|
|
|
Orientation = "Horizontal"
|
|
|
|
|
Padding="5, 0, 5, 0">
|
|
|
|
|
<StackLayout Spacing = "12"
|
|
|
|
|
Orientation = "Horizontal"
|
|
|
|
|
Padding="5, 0, 5, 0">
|
|
|
|
|
<Entry x:Name="pvEntry" Placeholder = "enter your private message"
|
|
|
|
|
VerticalOptions = "Center"
|
|
|
|
|
HorizontalOptions = "FillAndExpand"></Entry>
|
|
|
|
|
<!--
|
|
|
|
|
<!--
|
|
|
|
|
<controls:ExtendedPicker x:Name="contactPicker" Display="{Binding UserName}"></controls:ExtendedPicker>
|
|
|
|
|
-->
|
|
|
|
|
<controls:ExtendedPicker x:Name="contactPicker" />
|
|
|
|
|
<Button x:Name="sendPVButton" Text = "Send" HorizontalOptions = "End"
|
|
|
|
|
VerticalOptions = "Center"></Button>
|
|
|
|
|
-->
|
|
|
|
|
<controls:ExtendedPicker x:Name="contactPicker" />
|
|
|
|
|
<Button x:Name="sendPVButton" Text = "Send" HorizontalOptions = "End"
|
|
|
|
|
VerticalOptions = "Center"></Button>
|
|
|
|
|
</StackLayout>
|
|
|
|
|
<ListView x:Name="PVList" HasUnevenRows="true">
|
|
|
|
|
<ListView.ItemTemplate HeightRequest="80" VerticalOptions="StartAndExpand">
|
|
|
|
|
<ListView.ItemTemplate HeightRequest="80"
|
|
|
|
|
VerticalOptions="StartAndExpand">
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<ViewCell>
|
|
|
|
|
<ViewCell.View>
|
|
|
|
|
<StackLayout Orientation="Horizontal" VerticalOptions="StartAndExpand">
|
|
|
|
|
<Label Text="{Binding Date, StringFormat='{0:hh:mm}'}" FontAttributes="Italic" />
|
|
|
|
|
<Label Text="{Binding SenderId}" FontFamily="monospace" FontAttributes="Italic" />
|
|
|
|
|
<BoxView Color="#000090" WidthRequest="1" HeightRequest="15" />
|
|
|
|
|
<Label Text="{Binding Message}" FontFamily="monospace" />
|
|
|
|
|
<Label Text="{Binding Date, StringFormat='{0:hh:mm}'}" FontAttributes="Italic" />
|
|
|
|
|
<Label Text="{Binding SenderId}" FontFamily="monospace" FontAttributes="Italic" />
|
|
|
|
|
<BoxView Color="#000090" WidthRequest="1" HeightRequest="15" />
|
|
|
|
|
<Label Text="{Binding Message}" FontFamily="monospace" />
|
|
|
|
|
</StackLayout>
|
|
|
|
|
</ViewCell.View>
|
|
|
|
|
</ViewCell>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
</ListView>
|
|
|
|
|
<!-- <views:UserListView ItemsSource="" /> -->
|
|
|
|
|
</StackLayout>
|
|
|
|
|
|
|
|
|
|
</ContentPage>
|
|
|
|
|
<!-- <views:UserListView ItemsSource="" /> -->
|
|
|
|
|
</StackLayout>
|
|
|
|
|
|
|
|
|
|
</ContentPage>
|
|
|
|
|
</TabbedPage.Children>
|
|
|
|
|
</TabbedPage>
|