Files
BeWoPlaner/BeWo/View/ChatView.xaml
2016-09-16 13:45:25 +02:00

217 lines
14 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="NoResize">
<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="205,720,0,10" TextWrapping="Wrap" Text="Nachricht schreiben"
VerticalContentAlignment="Center" Width="432" 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="23" Height="25" Click="SmileyButton_OnClick">
<Image x:Name="Smiley" ToolTip="Zurzeit nicht zurechnungsfähig" Source="/BeWoPlaner;component/Ressources/Icons/trauriges-smiley.png" />
</Button>
</Grid>
<ListBox x:Name="Chat" HorizontalAlignment="Left" Height="630" Margin="204,64,0,0" VerticalAlignment="Top" Width="581" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" SelectionMode="Extended" MouseRightButtonDown="OnRightClickEvent" >
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<!--<Setter Property="IsEnabled" Value="False" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Focusable" Value="False"/>-->
<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> falls der Text von unten kommen soll
<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="190" SelectionChanged="ListBoxSelectedIndexChanged" Style="{DynamicResource ResourceKey=styleListBox}" ItemTemplate="{DynamicResource DataTemplate1}">
<ListView.Resources>
<DataTemplate x:Key="DataTemplate1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="15"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="22"/>
</Grid.ColumnDefinitions>
<Border BorderThickness="1" CornerRadius="3" Grid.RowSpan="2" Grid.ColumnSpan="4" Background="White" >
<Border.BorderBrush>
<SolidColorBrush Color="Black" />
</Border.BorderBrush>
</Border>
<Ellipse Width='30' Height='30'>
<Ellipse.Fill>
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill' />
</Ellipse.Fill>
</Ellipse>
<!--################################ Zu Test Zwecken ########################### -->
<StackPanel Grid.Column="1" Height="30" >
<Ellipse Width='15' Height='15' Fill="{Binding Path=Color}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</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="DarkRed" />
</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" />
<TextBlock Text="{Binding ItemCount}" FontSize="12" Foreground="OrangeRed" FontWeight="Bold" FontStyle="Italic" Margin="10,0,0,0" VerticalAlignment="Bottom" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListView.GroupStyle>
</ListView>
<!--###################################### Ende List view #######################################################-->
<Button x:Name="SendButton" Content="Senden" HorizontalAlignment="Left" Margin="672,720,0,0" VerticalAlignment="Top" Width="111" Click="SendButton_Click" Height="25"/>
<Label Content="Aktuelle Liste:" HorizontalAlignment="Left" Margin="10,41,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.622,0.045" Width="132"/>
</Grid>
</GroupBox>
<!-- Online | Offline | Beschäftigt -->
<ComboBox x:Name="StatusSetting" HorizontalAlignment="Left" Margin="17,53,0,0" VerticalAlignment="Top" Width="100" SelectionChanged="ComboBox_SelectionChanged"/>
<ListBox x:Name="AktChatUser" HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" Height="50" Margin="211,52,0,0" VerticalAlignment="Top" Width="329" ItemTemplate="{DynamicResource DataTemplate2}">
<ListBox.Resources>
<DataTemplate x:Key="DataTemplate2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<!-- <Border Margin="5" BorderBrush="DarkGray" BorderThickness="1"> -->
<Ellipse Width='30' Height='30'>
<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">
<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>