Skip to content

Instantly share code, notes, and snippets.

@georgechond94
Created February 20, 2016 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save georgechond94/5a22b0b808fff29ebb27 to your computer and use it in GitHub Desktop.
Save georgechond94/5a22b0b808fff29ebb27 to your computer and use it in GitHub Desktop.
<Page
x:Class="ChatApplication.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ChatApplication"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
>
<RelativePanel>
<TextBox x:Name="name" RelativePanel.AlignRightWithPanel="True" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignTopWithPanel="True"></TextBox>
<ListView x:Name="lv" ItemsSource="{Binding Messages}" RelativePanel.Above="rp" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True" RelativePanel.Below="name">
<ListView.ItemTemplate>
<DataTemplate x:DataType="local:ChatMessage">
<StackPanel Orientation="Horizontal">
<TextBlock>
<Run Text="{x:Bind Username}"></Run>
<Run Text=": "></Run>
<Run Text="{x:Bind Message}"></Run>
</TextBlock>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<RelativePanel x:Name="rp" RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True">
<TextBox x:Name="text" RelativePanel.AlignLeftWithPanel="True" RelativePanel.LeftOf="send" ></TextBox>
<Button x:Name="send" RelativePanel.AlignRightWithPanel="True" Content="Send" Click="send_Click"></Button>
</RelativePanel>
</RelativePanel>
</Page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment