bib_Talk_Chatprogramm/bibtalk/bib-talk/MainWindow.xaml
BlackViron c3ca4ec25d Chatfenster update
Leichte veränderungen
2024-06-10 16:38:42 +02:00

122 lines
6.2 KiB
XML

<Window x:Class="bib_talk.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="MainWindow"
Height="700"
Width="1000"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
<Window.Resources>
<Style x:Key="InvisibleButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="NoHoverButtonStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Border CornerRadius="15" BorderThickness="20" BorderBrush="#FF282828">
<Grid Margin="-10,-10,-10,-10" Background="#FF282828">
<!-- Draggable Area -->
<Grid VerticalAlignment="Top" Height="45" Background="Transparent" MouseLeftButtonDown="DraggableArea_MouseLeftButtonDown" Margin="0,-21,0,0">
</Grid>
<!-- Close Button -->
<Button Style="{StaticResource InvisibleButtonStyle}"
Width="30"
Height="30"
VerticalAlignment="Top"
HorizontalAlignment="Right"
Margin="0,0,0,0"
Click="CloseButton_Click">
<TextBlock Text="❌"
FontSize="20"
Foreground="White"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Button>
<TextBlock HorizontalAlignment="Left" x:Name="loggedinuser" Margin="32,11,0,0" TextWrapping="Wrap" Text="xxxx" VerticalAlignment="Top" Height="22" Width="146" Foreground="White"/>
<ListBox x:Name="onlineUsersListBox" Margin="32,84,728,50" d:ItemsSource="{d:SampleData ItemCount=5}" Background="#FF323134" BorderBrush="{x:Null}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Width="205" Height="60">
<Ellipse Width="10" Height="10" Fill="Green" Margin="5"/>
<Image Source="/PICA.jpg" Width="50" Height="50" Stretch="Fill">
<Image.Clip>
<EllipseGeometry Center="25,25" RadiusX="25" RadiusY="25"/>
</Image.Clip>
</Image>
<TextBlock Text="{Binding Username}" FontWeight="Bold" Foreground="#FF6332A0" RenderTransformOrigin="0.51,0.532" FontSize="18" Width="123" Height="30" Margin="10,0,0,0"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListBox x:Name="chatlistbox" Margin="244,84,0,50" d:ItemsSource="{d:SampleData ItemCount=5}" Background="#FF323134" BorderBrush="{x:Null}" Foreground="#FF6332A0" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="5">
<TextBlock Text="{Binding Username}" FontWeight="Bold" FontSize="20"/>
<TextBlock Text="{Binding Timestamp, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}" Foreground="Gray"/>
<TextBlock TextWrapping="Wrap" Text="{Binding Text}" FontSize="16"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBox
x:Name="messageBOX"
FontSize="20"
BorderBrush="Transparent"
Margin="244,642,154,10"
Background="#FF323134"
Foreground="White"
SelectionBrush="#FF6332A0"/>
<Button x:Name="weiterbutton" Click="send_Click" Content="Weiter" Foreground="White" Background="#FF6332A0" BorderThickness="0" Margin="831,642,44,10" BorderBrush="{x:Null}" Style="{StaticResource NoHoverButtonStyle}" RenderTransformOrigin="0.279,0.633"/>
</Grid>
</Border>
</Window>