<UserControl
   x:Class="OVCS.ClientWpf.Controls.ChatBox.ChatInputBox"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
   xmlns:local="clr-namespace:OVCS.ClientWpf.Controls.ChatBox"
   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
   d:DesignHeight="450"
   d:DesignWidth="800"
   mc:Ignorable="d">
    <UserControl.Resources>
        <Style x:Key="NewMenuItem" TargetType="{x:Type MenuItem}">
            <Setter Property="BorderBrush" Value="LightGray" />
            <Setter Property="BorderThickness" Value="12" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid
                           x:Name="_border"
                           Width="{TemplateBinding Width}"
                           Height="30"
                           Background="#FBFBFD">
                            <TextBlock
                               x:Name="_txt"
                               Text="{Binding Header, RelativeSource={RelativeSource TemplatedParent}}"
                               Margin="10,3"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Center" />
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" Value="#e8ecf1" TargetName="_border" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="DefaultContextMenu" TargetType="{x:Type ContextMenu}">
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
            <Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />
            <Setter Property="BorderBrush" Value="LightGray" />
            <Setter Property="Background" Value="#FBFBFD" />
            <Setter Property="BorderThickness" Value="2" />
            <Setter Property="OverridesDefaultStyle" Value="True" />
            <Setter Property="Grid.IsSharedSizeScope" Value="True" />
            <Setter Property="HasDropShadow" Value="True" />
            <Setter Property="Foreground" Value="#333" />
            <Setter Property="ItemContainerStyle" Value="{StaticResource NewMenuItem}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ContextMenu}">
                        <Grid>
                            <Border
                               x:Name="Border"
                               Margin="5"
                               Padding="{TemplateBinding Padding}"
                               Background="{TemplateBinding Background}"
                               BorderBrush="LightGray"
                               BorderThickness="2"
                               SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <ItemsPresenter
                                   x:Name="ItemsPresenter"
                                   Margin="0"
                                   Grid.IsSharedSizeScope="True"
                                   KeyboardNavigation.DirectionalNavigation="Cycle"
                                   KeyboardNavigation.TabNavigation="Cycle"
                                   SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>



    </UserControl.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="34*" />
            <ColumnDefinition Width="347*" />
        </Grid.ColumnDefinitions>
        <RichTextBox
           x:Name="inputbox"
           Grid.ColumnSpan="2"
           Height="108"
           VerticalContentAlignment="Center"
           Background="White"
           BorderThickness="0"
           DragDrop.Drop="Inputbox_Drop"
           PreviewKeyDown="inputbox_PreviewKeyDown"
           VerticalScrollBarVisibility="Auto">
            <RichTextBox.Document>
                <FlowDocument Focusable="True" LineHeight="4" />
            </RichTextBox.Document>
            <RichTextBox.ContextMenu>
                <ContextMenu Style="{StaticResource DefaultContextMenu}">
                    <MenuItem Click="CopyMenuItem_Click" Header="复制" />
                    <MenuItem Click="PasteMenuItem_Click" Header="粘贴" />
                </ContextMenu>
            </RichTextBox.ContextMenu>
        </RichTextBox>
        <Border
           x:Name="bannedLabel"
           Grid.ColumnSpan="2"
           Height="108"
           Background="#c2c3c9"
           BorderThickness="0"
           Visibility="Collapsed">
            <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                <TextBlock
                   Name="groupBan"
                   Text="禁言中..."
                   Grid.ColumnSpan="2"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   FontSize="16"
                   Foreground="White" />
            </Grid>
        </Border>
    </Grid>
</UserControl>
