From 410945af206298da3575d44e55dc32c4a4a2a166 Mon Sep 17 00:00:00 2001 From: LynJet <104435916+LynJet@users.noreply.github.com> Date: Mon, 11 Jul 2022 16:01:14 +0200 Subject: [PATCH] =?UTF-8?q?Massennachricht=20hinzugef=C3=BCgt=20Optik=20an?= =?UTF-8?q?=20die=20vom=20Android-=20und=20Webclient=20angepasst=20Asynchr?= =?UTF-8?q?one=20Methoden=20verbessert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChatController/ChatController.csproj | 6 + ChatController/ChatKlassen/ChatMessage.cs | 9 +- ChatController/ChatKlassen/Contact.cs | 11 + ChatController/ChatMainControl.xaml | 279 ++++++++--- ChatController/ChatMainControl.xaml.cs | 462 +++++++++++++++--- ...oadcastCheckBoxVisibilityMultiConverter.cs | 30 ++ ChatController/HauptKlassen/Chat.cs | 84 +++- ChatController/LoginControl.xaml | 10 +- ChatController/Ressourcen/TasksSolid.png | Bin 0 -> 425 bytes ChatController/Utilities/BroadcastMessage.cs | 68 +++ .../Utilities/BroadcastProgressReportModel.cs | 7 + .../Extensions/ObservableSortCollection.cs | 105 ++++ ChatController/Utilities/ListItemHelper.cs | 19 + ChatController/Utilities/Utils.cs | 3 + PrototypChat/.vs/PrototypChat/v16/.suo | Bin 243712 -> 281088 bytes PrototypChat/MainWindow.xaml | 1 + PrototypChat/MainWindow.xaml.cs | 6 + 17 files changed, 929 insertions(+), 171 deletions(-) create mode 100644 ChatController/Converter/BroadcastCheckBoxVisibilityMultiConverter.cs create mode 100644 ChatController/Ressourcen/TasksSolid.png create mode 100644 ChatController/Utilities/BroadcastMessage.cs create mode 100644 ChatController/Utilities/BroadcastProgressReportModel.cs create mode 100644 ChatController/Utilities/Extensions/ObservableSortCollection.cs create mode 100644 ChatController/Utilities/ListItemHelper.cs 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}"> - - + - +