<UserControl x:Class="BeWo.View.Controls.CustomerSelectionControl"
             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:localsearch="clr-namespace:BeWo.View.Search" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
      </Grid.RowDefinitions>
      <!--<Label x:Name="labelTitle" Content="Gruppenauswahl" FontSize="12" FontWeight="Bold" />-->
      <Grid Background="{DynamicResource CustomerListBrush}" MouseDown="btnSelectCustomer_Click" Grid.Row="1">
        <Grid.RowDefinitions>
          <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid >
          <Border x:Name="ItemContent"  MinHeight="25">
            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="3,2,1,2" OpacityMask="{x:Null}" SnapsToDevicePixels="True">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
              </Grid.RowDefinitions>
              <StackPanel Orientation="Horizontal">
                <Image x:Name="img" Source="..\..\Ressources\Icons\UserGroupDisabled.png" Height="20" VerticalAlignment="Center" HorizontalAlignment="Left" Width="Auto" Visibility="Hidden" />
                <StackPanel Orientation="Vertical">
                  <TextBlock FontSize="14" Foreground="#FFD2D2D2" x:Name="FullName" Tag="{Binding}" Margin="3 2" Text="{Binding Name}" VerticalAlignment="Center" TextWrapping="Wrap" />
                </StackPanel>
              </StackPanel>

              <Button Grid.Column="2" Grid.RowSpan="3" x:Name="btnSelectCustomer"
                  ToolTip="Gruppe auswählen" Tag="{Binding}" Width="26" Height="Auto"  Click="btnSelectCustomer_Click" Margin="0">
                <Border Grid.RowSpan="2" Margin="0"  HorizontalAlignment="Center" VerticalAlignment="Center" >
                  <Canvas VerticalAlignment="Center" HorizontalAlignment="Center" Width="20" Height="20" Margin="0,0,0,0" >
                    <Ellipse x:Name="lupe1" Stroke="#FFFFFFFF" Height="14" Width="14" StrokeThickness="2" Fill="{x:Null}" />
                    <Line x:Name="lupe2" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FFFFFFFF" Canvas.Left="10" Canvas.Top="11.4" Y1="0" Y2="6" StrokeThickness="3" X2="5" />


                  </Canvas>
                </Border>
              </Button>
            </Grid>
          </Border>
        </Grid>
        <Popup x:Name="popupCustomers" StaysOpen="False" Placement="MousePoint" Width="400" Grid.Row="1" Height="400" >
          <localsearch:CustomerSearchView x:Name="SearchView" ItemSelected="CustomerSearchView_ItemSelected" />
        </Popup>
      </Grid>
    </Grid>
</UserControl>
