252 lines
16 KiB
XML
252 lines
16 KiB
XML
<Window x:Class="BeWo.View.ChatView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:view="clr-namespace:BeWo.View"
|
|
Title="Chat View" Height="800" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None"
|
|
AllowsTransparency="True"
|
|
Background="Transparent"
|
|
ResizeMode="CanResizeWithGrip"
|
|
x:Name="ChatViewName">
|
|
<Grid >
|
|
<GroupBox Header="Chat" x:Name="rootGroupBox" Style="{DynamicResource MainContentGroupBoxWithoutMaximizeBtnStyle}" MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown">
|
|
<Grid Background="{StaticResource ObjectEditBackgroundBrush}" >
|
|
|
|
<!--<TextBox x:Name="ServerStats" Height="23" Margin="539,13,7,0" TextWrapping="Wrap" VerticalAlignment="Top" ToolTip="Server Info" IsEnabled="False" VerticalContentAlignment="Center">
|
|
<TextBox.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="3"/>
|
|
<Setter Property="Padding" Value="10,0,0,0" />
|
|
</Style>
|
|
</TextBox.Resources>
|
|
</TextBox>-->
|
|
|
|
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBox x:Name="Chatbox" HorizontalAlignment="Left" Margin="221,720,0,10" TextWrapping="Wrap" Text="Nachricht schreiben" TextChanged="Chatbox_OnTextChanged" VerticalScrollBarVisibility="Auto" MaxLines="5" MaxHeight="70"
|
|
VerticalContentAlignment="Center" Width="416" MinHeight="25" ToolTip="Schreiben Sie hier eine Nachricht hinein" KeyDown="OnKeyDownHandler" GotFocus="OnFocus" Foreground="DarkGray" >
|
|
<TextBox.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="3"/>
|
|
<Setter Property="Padding" Value="10,0,0,0" />
|
|
</Style>
|
|
</TextBox.Resources>
|
|
</TextBox>
|
|
<Button HorizontalAlignment="Left" x:Name="EmojiButton" Margin="642,720,-18,0" VerticalAlignment="Top" Width="25" Height="25" Click="SmileyButton_OnClick">
|
|
<Image x:Name="Smiley" ToolTip="Smiley einfügen" Source="/BeWoPlaner;component/Ressources/Icons/glucklicher.png" Stretch="UniformToFill" VerticalAlignment="Center" HorizontalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality" />
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<ListBox x:Name="Chat" HorizontalAlignment="Left" Height="630" Margin="221,64,0,0" VerticalAlignment="Top" Width="564" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" SelectionMode="Extended" MouseRightButtonDown="OnRightClickEvent" >
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="ListBoxItem">
|
|
<Setter Property="HorizontalAlignment" Value="{Binding Posi}" />
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
<ListBox.Resources>
|
|
<Style TargetType="Border">
|
|
<Setter Property="CornerRadius" Value="3"/>
|
|
<Setter Property="Padding" Value="10,0,0,0" />
|
|
</Style>
|
|
</ListBox.Resources>
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border BorderBrush="{Binding ChatColor}" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" Background="{Binding ChatColor}">
|
|
<DockPanel MinHeight="15" Margin="5" LastChildFill="True" Background="{Binding ChatColor}" >
|
|
|
|
<StackPanel DockPanel.Dock="Bottom" >
|
|
<TextBlock VerticalAlignment="Center" Text="{Binding UserMessage}" MinWidth="0" MaxWidth="500" TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
|
|
<StackPanel DockPanel.Dock="Left" Margin="0,0,0,5">
|
|
<TextBlock Text="{Binding Username}" FontWeight="Bold" MaxWidth="150" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel DockPanel.Dock="Right" Margin="5,0,0,5">
|
|
<TextBlock Text="{Binding SendTime}" MaxWidth="350" HorizontalAlignment="Right" TextAlignment="Right" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
|
|
</DockPanel>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
<!-- <ListBox.ItemsPanel> der Text kommt von unten und die neuste nachricht steht immer oben
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel VerticalAlignment="Bottom"/>
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>-->
|
|
</ListBox>
|
|
|
|
|
|
|
|
<!--###################################### Liste aller User mit Chat Berechtigung ###################################################### -->
|
|
<ListView x:Name="Clientlist" HorizontalAlignment="Left" Height="680" Margin="10,64,0,0" VerticalAlignment="Top" Width="206" SelectionChanged="ListBoxSelectedIndexChanged" Style="{DynamicResource ResourceKey=styleListBox}" ItemTemplate="{DynamicResource DataTemplate1}">
|
|
<ListView.Resources>
|
|
<DataTemplate x:Key="DataTemplate1">
|
|
<Grid Margin="7,0,0,0" x:Name="GridMargin">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="35"/>
|
|
<ColumnDefinition Width="7"/>
|
|
<ColumnDefinition Width="100"/>
|
|
<ColumnDefinition Width="25"/>
|
|
<ColumnDefinition Width="12"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Border BorderThickness="0.25" CornerRadius="3" Grid.RowSpan="2" Grid.ColumnSpan="5" Background="White" >
|
|
<Border.BorderBrush>
|
|
<SolidColorBrush Color="Black" />
|
|
</Border.BorderBrush>
|
|
</Border>
|
|
|
|
<Ellipse Width='30' Height='30' RenderOptions.BitmapScalingMode="HighQuality">
|
|
<Ellipse.Fill>
|
|
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill' RenderOptions.BitmapScalingMode="HighQuality" />
|
|
</Ellipse.Fill>
|
|
</Ellipse>
|
|
|
|
<StackPanel Grid.Column="1" Height="30" >
|
|
<Ellipse Width='7' Height='7' Fill="{Binding Path=Color}" Margin="-23,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Fill" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Column="2" Margin="5" >
|
|
<StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" >
|
|
<TextBlock Text="{Binding Path=Name, FallbackValue=FirstName}" />
|
|
</StackPanel>
|
|
<!-- <TextBlock Text="{Binding Path=StatusTyp, FallbackValue=Message}" />-->
|
|
</StackPanel>
|
|
|
|
<!--Für die anzeige der anzahl ungelesener Nachrichten Height="30"-->
|
|
<StackPanel Grid.Column="3" Margin="5">
|
|
<TextBlock Text="{Binding Path=Receivems}" FontWeight="Bold" Foreground="Black" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Column="4" Margin="7,0,0,0">
|
|
<Rectangle Fill="{Binding Path=ColorType}" Stretch="Fill" Height="30" Width="2" />
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListView.Resources>
|
|
|
|
|
|
<!--Uberschríft Mitarbeiter, ItemCount-->
|
|
<ListView.GroupStyle>
|
|
<GroupStyle>
|
|
<GroupStyle.ContainerStyle>
|
|
<Style TargetType="{x:Type GroupItem}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Expander IsExpanded="True">
|
|
<Expander.Header>
|
|
<StackPanel Orientation="Horizontal" >
|
|
<TextBlock Text="{Binding Name}" FontWeight="Bold" Foreground="Black" FontSize="18" VerticalAlignment="Bottom" Width="148" />
|
|
<TextBlock Text="{Binding ItemCount}" FontSize="12" Foreground="Black" FontWeight="Bold" Margin="10,0,0,1" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
|
|
|
|
</StackPanel>
|
|
</Expander.Header>
|
|
<ItemsPresenter />
|
|
</Expander>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</GroupStyle.ContainerStyle>
|
|
</GroupStyle>
|
|
</ListView.GroupStyle>
|
|
|
|
</ListView>
|
|
|
|
|
|
|
|
|
|
<Button x:Name="SendButton" Content="Senden" HorizontalAlignment="Left" Margin="672,720,0,0" VerticalAlignment="Top" Width="111" Click="SendButton_Click" Height="25"/>
|
|
|
|
|
|
|
|
<Grid Margin="10,13,574,691" Width="206" Height="50">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="25"/>
|
|
<RowDefinition Height="20"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="206"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" Width="180" HorizontalAlignment="Left" >
|
|
<Label Content="Mein Status: " Width="80"/>
|
|
<RadioButton GroupName="status" x:Name="RadioButtonOnline" BorderBrush="Green" Width="15" ToolTip="Online" VerticalAlignment="Center" Checked="ComboBox_SelectionChanged" Foreground="Green"/>
|
|
<RadioButton GroupName="status" x:Name="RadioButtonOffline" BorderBrush="Red" Width="15" ToolTip="Offline" VerticalAlignment="Center" Checked="ComboBox_SelectionChanged" Foreground="Red"/>
|
|
<RadioButton GroupName="status" x:Name="RadioButtonBeschaeftigt" BorderBrush="DarkOrange" Width="15" ToolTip="Beschäftigt" VerticalAlignment="Center" Checked="ComboBox_SelectionChanged" Foreground="DarkOrange"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="0" Width="20" HorizontalAlignment="Right" Orientation="Horizontal" >
|
|
<Button Style="{DynamicResource IconButtonStyle}" x:Name="ButtonSortLabel" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Right" VerticalAlignment="Center" Width="20" Height="20" Click="ButtonSortLabel_OnClick" >
|
|
<Image x:Name="SortLabel" ToolTip="Sortierung ändern" Source="pack://application:,,,/Ressources/icons/unsortiert.png" />
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
<TextBox x:Name="Suche" Grid.Column="1" VerticalContentAlignment="Center" KeyDown="Suche_OnKeyDown" Grid.Row="1" TextChanged="Suche_OnTextChanged" LostFocus="Suche_OnLostFocus">
|
|
<TextBox.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="3"/>
|
|
<Setter Property="Padding" Value="5,0,0,0" />
|
|
</Style>
|
|
</TextBox.Resources>
|
|
</TextBox>
|
|
</Grid>
|
|
|
|
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<ListBox x:Name="AktChatUser" HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" Height="50" Margin="228,52,0,0" VerticalAlignment="Top" Width="312" ItemTemplate="{DynamicResource DataTemplate2}">
|
|
<ListBox.Resources>
|
|
<DataTemplate x:Key="DataTemplate2">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="50"/>
|
|
<ColumnDefinition Width="100"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="50" />
|
|
</Grid.RowDefinitions>
|
|
<!-- <Border Margin="5" BorderBrush="DarkGray" BorderThickness="1"> -->
|
|
<Ellipse Width='30' Height='30' VerticalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality">
|
|
<Ellipse.Fill >
|
|
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill'/>
|
|
</Ellipse.Fill>
|
|
</Ellipse>
|
|
<!-- <Image Source="{Binding Path=Image}" Stretch="Fill" Width="30" Height="30" />-->
|
|
<!-- </Border> -->
|
|
<StackPanel Grid.Column="1" Margin="5" VerticalAlignment="Center">
|
|
<StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" >
|
|
|
|
<TextBlock Text="{Binding Path=Name, FallbackValue=FirstName}" />
|
|
</StackPanel>
|
|
<!-- <TextBlock Text="{Binding Path=StatusTyp, FallbackValue=Message}" />-->
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListBox.Resources>
|
|
</ListBox>
|
|
|
|
|
|
<Button Style="{DynamicResource IconButtonStyle}" x:Name="ButtonAlarmLabel" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Left" Height="20" Margin="725,10,0,0" VerticalAlignment="Top" Width="20" Visibility="Collapsed" >
|
|
<Image x:Name="AlarmLabel" ToolTip="Zurzeit nicht Verbunden" Source="" />
|
|
</Button>
|
|
</Grid>
|
|
</Window>
|
|
|
|
|