ChatMessages on THEEEEEEEEEEEEEEE RIGHT
This commit is contained in:
committed by
Felix Hartmann (PEA3-Fe-FI)
parent
31ffe86f04
commit
ba4d0b619e
@@ -42,8 +42,8 @@ namespace PolyChat
|
||||
Serve();
|
||||
|
||||
// test
|
||||
UIController.OnIncomingConnection("localhost");
|
||||
/*
|
||||
UIController.OnIncomingConnection("1.1.1.1");
|
||||
UIController.OnIncomingConnection("1.2.3.4");
|
||||
UIController.OnIncomingConnection("1.2.4.8");
|
||||
*/
|
||||
|
||||
@@ -96,13 +96,16 @@
|
||||
<!-- CHAT -->
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden">
|
||||
<ListView x:Name="listViewMessages" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="4 16">
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:ChatMessage">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
|
||||
<StackPanel HorizontalAlignment="{x:Bind Align}" x:Name="Message" MaxWidth="320" Margin="0 4" Padding="16 8" CornerRadius="4" Background="{ThemeResource SystemAccentColor}">
|
||||
<TextBlock Text="{x:Bind Content}" Foreground="{ThemeResource SystemAltHighColor}" TextWrapping="WrapWholeWords" FontSize="14"/>
|
||||
<TextBlock Text="{x:Bind TimeStamp.ToString()}" Foreground="{ThemeResource SystemAltMediumColor}"/>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="{x:Bind Align}" x:Name="Message" MaxWidth="320" Margin="0 4" Padding="16 8" CornerRadius="4" Background="{ThemeResource SystemAccentColor}">
|
||||
<TextBlock Text="{x:Bind Content}" Foreground="{ThemeResource SystemAltHighColor}" TextWrapping="WrapWholeWords" FontSize="14"/>
|
||||
<TextBlock Text="{x:Bind TimeStamp.ToString()}" Foreground="{ThemeResource SystemAltMediumColor}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
|
||||
@@ -87,16 +87,16 @@ namespace PolyChat
|
||||
public async void OnOpenNewChatDialog(object sender = null, RoutedEventArgs e = null)
|
||||
{
|
||||
// test
|
||||
/*
|
||||
/**/
|
||||
OnIncomingMessage(
|
||||
"1.1.1.1",
|
||||
"localhost",
|
||||
new JObject(
|
||||
new JProperty("type", "username"),
|
||||
new JProperty("content", "Cloudflare")
|
||||
new JProperty("type", "message"),
|
||||
new JProperty("content", "Test")
|
||||
).ToString(),
|
||||
DateTime.Now
|
||||
);
|
||||
*/
|
||||
/**/
|
||||
NewChatDialog dialog = new NewChatDialog();
|
||||
var result = await SafelyOpenDialog(dialog);
|
||||
if (result == ContentDialogResult.Primary)
|
||||
|
||||
Reference in New Issue
Block a user