Files
BeWoPlaner/BeWo/View/ChatView.xaml
2016-08-26 10:36:50 +02:00

177 lines
11 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>
<TextBox x:Name="Chatbox" HorizontalAlignment="Left" Margin="204,720,0,10" TextWrapping="Wrap"
VerticalContentAlignment="Center" Width="432" Height="25" ToolTip="Schreiben Sie hier eine Nachricht hinein" KeyDown="OnKeyDownHandler" GotFocus="OnFocus" Text="Nachricht schreiben" 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>
<ListBox x:Name="Chat" HorizontalAlignment="Left" Height="630" Margin="204,64,0,0" VerticalAlignment="Top" Width="581" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" SelectionMode="Multiple" >
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<!--<Setter Property="IsEnabled" Value="False" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Focusable" Value="False"/>-->
</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="Fuchsia" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8">
<DockPanel MinHeight="15" Margin="5" LastChildFill="True" >
<WrapPanel DockPanel.Dock="Top">
<TextBlock Text="{Binding Username}" FontWeight="Bold" Width="150" TextAlignment="Left"/>
<TextBlock Text="{Binding SendTime}" Margin="2" Width="350" HorizontalAlignment="Right" TextAlignment="Right"/>
</WrapPanel>
<TextBlock Text="{Binding UserMessage}" Width="500" TextWrapping="Wrap" VerticalAlignment="Center" />
</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="100"/>
<ColumnDefinition Width="22"/>
</Grid.ColumnDefinitions>
<Ellipse Width='30' Height='30'>
<Ellipse.Fill>
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill' />
</Ellipse.Fill>
</Ellipse>
<StackPanel Grid.Column="1" Margin="5">
<StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" >
<TextBlock Text="{Binding Path=Name, FallbackValue=FirstName}" />
</StackPanel>
<TextBlock Text="{Binding Path=Lastms, FallbackValue=Message}" />
</StackPanel>
<!--Für die anzeige der anzahl ungelesener Nachrichten -->
<StackPanel Grid.Column="2" 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="DeepPink" 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="210,52,0,0" VerticalAlignment="Top" Width="330" 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=Lastms, FallbackValue=Message}" />
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.Resources>
</ListBox>
<Button Style="{DynamicResource IconButtonStyle}" x:Name="ButtonAlarmLabel" Background="Transparent" BorderBrush="Transparent" Click="ReConnect" 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>