diff --git a/ChatController/ChatController.csproj b/ChatController/ChatController.csproj index 104c59d..de91cda 100644 --- a/ChatController/ChatController.csproj +++ b/ChatController/ChatController.csproj @@ -67,6 +67,7 @@ ChatMainControl.xaml + @@ -99,10 +100,14 @@ True Resource.resx + + + + @@ -148,6 +153,7 @@ + diff --git a/ChatController/ChatKlassen/ChatMessage.cs b/ChatController/ChatKlassen/ChatMessage.cs index b556226..a9f5358 100644 --- a/ChatController/ChatKlassen/ChatMessage.cs +++ b/ChatController/ChatKlassen/ChatMessage.cs @@ -4,10 +4,11 @@ using System.ComponentModel; using System.Windows.Documents; using System.Windows.Media; using ChatController.Core; -using ChatController.HauptKlassen; using ChatController.Utilities; using static System.Windows.HorizontalAlignment; using Application = System.Windows.Application; +using Brush = System.Windows.Media.Brush; +using Color = System.Windows.Media.Color; using HorizontalAlignment = System.Windows.HorizontalAlignment; namespace ChatController.ChatKlassen @@ -147,9 +148,11 @@ namespace ChatController.ChatKlassen public string SendTimeString => SendTime.Date == DateTime.Today ? $"Heute {SendTime:HH:mm}" : SendTime.ToString("dd. MMM HH:mm"); - public Brush BorderBrush => IsSeparator ? new SolidColorBrush(Colors.Transparent) : IsMyMessage ? new SolidColorBrush(Color.FromRgb(255, 90, 0)) : new SolidColorBrush(Color.FromRgb(229, 229, 229)); + public Brush BorderBrush => IsSeparator ? new SolidColorBrush(Colors.Transparent) : IsMyMessage ? new SolidColorBrush(Color.FromRgb(255, 90, 0)) : new SolidColorBrush(Color.FromRgb(255, 255, 255)); - public Brush HighlightedBorderBrush => IsSeparator ? new SolidColorBrush(Colors.Transparent) : IsMyMessage ? new SolidColorBrush(Color.FromRgb(255, 153, 153)) : new SolidColorBrush(Color.FromRgb(247, 247, 247)); + public Brush HighlightedBorderBrush => IsSeparator ? new SolidColorBrush(Colors.Transparent) : IsMyMessage ? new SolidColorBrush(Color.FromRgb(255, 152, 143)) : new SolidColorBrush(Color.FromRgb(247, 247, 247)); + + public Brush TextColor => !IsMyMessage && !IsSeparator ? new SolidColorBrush(Colors.Black) : new SolidColorBrush(Colors.White); public Brush Foreground => new BrushConverter().ConvertFromString("#505050") as SolidColorBrush; diff --git a/ChatController/ChatKlassen/Contact.cs b/ChatController/ChatKlassen/Contact.cs index b4995a0..9ab8f2d 100644 --- a/ChatController/ChatKlassen/Contact.cs +++ b/ChatController/ChatKlassen/Contact.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Windows; using System.Windows.Media; using ChatController.Core; using ChatController.LoginKlassen; @@ -179,4 +180,14 @@ namespace ChatController.ChatKlassen handler?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } + + public class ContactDependencyObject : DependencyObject + { + public Contact Contact { get; set; } + + public ContactDependencyObject(Contact contact) + { + Contact = contact; + } + } } diff --git a/ChatController/ChatMainControl.xaml b/ChatController/ChatMainControl.xaml index 2a0aef2..713f447 100644 --- a/ChatController/ChatMainControl.xaml +++ b/ChatController/ChatMainControl.xaml @@ -7,18 +7,132 @@ xmlns:chatKlassen="clr-namespace:ChatController.ChatKlassen" xmlns:core="clr-namespace:ChatController.Core" xmlns:chatController="clr-namespace:ChatController" - mc:Ignorable="d" x:Name="ChatControlling" + xmlns:utilities="clr-namespace:ChatController.Utilities" + mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="600" Loaded="ChatMainControl_OnLoaded" SnapsToDevicePixels="True" d:DataContext="{d:DesignData ChatMainControl}"> - + + - - + + + + + + + + + - + - + - - + + @@ -171,8 +302,8 @@ - - + + @@ -188,9 +319,16 @@ - - + @@ -201,12 +339,16 @@ - + + - + @@ -254,6 +396,7 @@ Background="{StaticResource LightBackColor}" ContextMenuOpening="Chat_OnContextMenuOpening" Padding="20" + Visibility="{Binding Path=Chat.IsInBroadcastMode, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type chatController:ChatMainControl}}, Converter={StaticResource BoolToVisibilityConverter}}" d:DataContext="{d:DesignData ChatMessage}"> - - + - +