LD-KickWatch/src/KickStreamHub/Views/ChatWindow.xaml

119 lines
6.8 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<Window x:Class="KickStreamHub.Views.ChatWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:helpers="clr-namespace:KickStreamHub.Helpers"
Title="{Binding ChannelName, StringFormat='{}{0} — Canlı Sohbet (LD KickWatch)'}"
Icon="pack://application:,,,/Resources/app.ico"
Height="680" Width="430" MinWidth="320" MinHeight="420"
WindowStartupLocation="CenterScreen"
Topmost="{Binding IsTopMost}" ResizeMode="CanResizeWithGrip"
Opacity="{Binding BackgroundOpacity}"
Background="#060A10">
<Grid Margin="12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Row 0: Chat Header -->
<Border Grid.Row="0" Background="#0D141F" CornerRadius="10" Padding="12,8" Margin="0,0,0,8" BorderBrush="#1C283B" BorderThickness="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock FontSize="15" FontWeight="ExtraBold" Foreground="#53FC18"
Text="{Binding ChannelName, StringFormat='💬 {0}'}" VerticalAlignment="Center" />
<Border Background="#152234" CornerRadius="6" Padding="7,2" Margin="10,0,0,0" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<Ellipse Width="7" Height="7" Margin="0,0,5,0" VerticalAlignment="Center"
Fill="{Binding IsConnected, Converter={StaticResource LiveToBrush}}" />
<TextBlock Foreground="#CBD5E1" FontSize="10.5" FontWeight="SemiBold" VerticalAlignment="Center"
Text="{Binding IsConnected, Converter={StaticResource ChatConnTextConverter}}" />
</StackPanel>
</Border>
</StackPanel>
<CheckBox Grid.Column="1" Content="📌 Üstte Tut" Foreground="#CBD5E1" FontSize="11.5" VerticalAlignment="Center"
IsChecked="{Binding IsTopMost}" ToolTip="Pencereyi her zaman üstte tut" />
</Grid>
</Border>
<!-- Row 1: Filter & Controls -->
<Grid Grid.Row="1" Margin="0,0,0,8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Margin="0,0,6,0" FontSize="12"
Tag="🔍 Mesaj veya kullanıcı ara..."
Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}" />
<Button Grid.Column="1" Content="{Binding IsPaused, Converter={StaticResource PauseTextConverter}}"
Style="{StaticResource SecondaryButton}" Margin="0,0,5,0"
Command="{Binding TogglePauseCommand}" Padding="10,6" FontSize="11" />
<Button Grid.Column="2" Content="🗑" Style="{StaticResource DangerButton}"
Command="{Binding ClearMessagesCommand}" Padding="9,6" FontSize="11" ToolTip="Sohbeti Temizle" />
</Grid>
<!-- Row 2: Messages List -->
<Border Grid.Row="2" Background="#0A0F17" BorderBrush="#1A2638" BorderThickness="1" CornerRadius="10" Padding="4">
<ListBox x:Name="ChatListBox"
ItemsSource="{Binding FilteredMessages}"
Background="Transparent" BorderThickness="0"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.CanContentScroll="False"
VirtualizingPanel.ScrollUnit="Pixel">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Background="#0E1520" CornerRadius="6" Padding="8,5" Margin="2,2">
<TextBlock TextWrapping="Wrap"
FontSize="{Binding DataContext.FontSize, RelativeSource={RelativeSource AncestorType=Window}}"
helpers:RichChatHelper.MessageItem="{Binding}" />
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Focusable" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Border>
<!-- Row 3: Font & Opacity Sliders -->
<Border Grid.Row="3" Background="#0D141F" CornerRadius="8" Padding="10,7" Margin="0,8,0,0" BorderBrush="#1C283B" BorderThickness="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="🔠 Boyut:" Foreground="#94A3B8" FontSize="11" VerticalAlignment="Center" Margin="0,0,6,0" />
<Slider Grid.Column="1" Minimum="10" Maximum="22" Value="{Binding FontSize}"
TickFrequency="1" IsSnapToTickEnabled="True" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="👁 Saydamlık:" Foreground="#94A3B8" FontSize="11"
VerticalAlignment="Center" Margin="12,0,6,0" />
<Slider Grid.Column="3" Minimum="0.35" Maximum="1.0" Value="{Binding BackgroundOpacity}"
TickFrequency="0.05" IsSnapToTickEnabled="True" VerticalAlignment="Center" />
</Grid>
</Border>
</Grid>
</Window>