<UserControl x:Class="_1RM.Controls.NoteDisplay.NoteIcon"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:attachProperty="clr-namespace:Shawn.Utils.WpfResources.Theme.AttachProperty;assembly=Shawn.Utils.WpfResources"
             xmlns:noteDisplay="clr-namespace:_1RM.Controls.NoteDisplay"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance noteDisplay:NoteIcon}"
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <noteDisplay:ConverterNoteToSingleLineNote x:Key="ConverterNoteToSingleLineNote" />
    </UserControl.Resources>
    <Grid Visibility="{Binding Server.Note, Converter={StaticResource ConverterNoteToVisibility}}">
        <!--icon button show note-->
        <Border Height="30" Width="30" Name="GridParent" HorizontalAlignment="Left" >
            <Grid Name="ButtonShowNote"
                  Width="20" Height="20"
                  Margin="5"
                  Background="Transparent"
                  MouseEnter="ButtonShowNote_OnMouseEnter"
            >
                <Path Data="{StaticResource NoteGeometry}"
                      Width="16" Height="16"
                      Stroke="{DynamicResource BackgroundTextBrush}"
                      Fill="{DynamicResource BackgroundTextBrush}"
                      StrokeThickness="0" Stretch="Uniform" />
            </Grid>
        </Border>
        <Grid Name="GridBriefNote" Visibility="Collapsed" MouseEnter="ButtonShowNote_OnMouseEnter">
            <TextBlock Margin="25 5 5 5" 
                       Style="{StaticResource TextBlockBase}"
                       HorizontalAlignment="Left" 
                       MaxWidth="400"
                       Text="{Binding Server.Note, Converter={StaticResource ConverterNoteToSingleLineNote}}" 
                       TextWrapping="NoWrap"
                       Foreground="{DynamicResource BackgroundTextBrush}" 
                       TextTrimming="CharacterEllipsis"></TextBlock>
        </Grid>



        <Popup Name="PopupNote" 
               AllowsTransparency="True"
               PlacementTarget="{Binding ElementName=ButtonShowNote}" 
               Placement="Right"
               StaysOpen="False">
            <ContentControl Name="PopupNoteContent"></ContentControl>
        </Popup>
    </Grid>
</UserControl>
