<localView:BeWoView x:Class="BeWo.View.Detail.Accounting.EquityInvoiceView" 
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:localView="clr-namespace:BeWo.View"
                    xmlns:localsearch="clr-namespace:BeWo.View.Search"
                    xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
                    Height="Auto" Width="Auto" HorizontalAlignment="Stretch" 
                    VerticalAlignment="Stretch" Focusable="True" >
	<Grid>
		<GroupBox Style="{StaticResource ObjectEditGroupBox}" Header="Rechnungen für Eigenanteil">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="*" />
				</Grid.RowDefinitions>
				<Grid HorizontalAlignment="Stretch">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition Width="*" />
					</Grid.ColumnDefinitions>
					<TextBlock Foreground="Black" FontSize="12" Grid.Column="0" VerticalAlignment="Center" Text="Hilfeplan:" />
					<uc:PopUpEdit x:Name="popupedit_CostBeaerer" Width="250" Height="23" Margin="3" Grid.Column="1" 
                                  IsReadOnly="True" DeleteButtonVisibility="Collapsed" 
                                  PopUpClick="popupedit_CostBeaerer_PopUpClick" MaxWidth="300" 
                                  Cursor="Arrow" PreviewMouseDoubleClick="Popupedit_CostBeaerer_OnPreviewMouseDoubleClick"/>
					<Popup Margin="10" x:Name="popup_costBearer" StaysOpen="False" Placement="MousePoint" Width="400" Grid.Row="2" Height="400" Closed="popup_Closed" Opened="popup_Opened">
                        <localsearch:SupportConceptSearchView x:Name="supportconceptsearchview" ItemSelected="SupportConceptSearchView_ItemSelected" SearchMode="All" />
					</Popup>
					<Button Height="23" VerticalAlignment="Center" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch" Margin="5 0 0 0" Grid.Column="2" Visibility="{Binding Text, ElementName=popupedit_CostBeaerer, Converter={StaticResource ObjectVisibilityConverter}}" ToolTip="Hinzufügen" Name="button_addCostBearer" Click="bt_add_Click" Content="Neue Rechnung erstellen"></Button>
				</Grid>
				<ListView HorizontalContentAlignment="Stretch" Name="lb_invoivces" Background="{x:Null}" BorderBrush="{x:Null}" ItemsSource="{Binding VMList, Mode=OneWay}" Grid.Row="1" ScrollViewer.VerticalScrollBarVisibility="Auto">
					<ListView.ItemContainerStyle>
						<Style TargetType="{x:Type ListBoxItem}">
							<Setter Property="Focusable" Value="false" />
						</Style>
					</ListView.ItemContainerStyle>
					<ListView.Resources>
						<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
						<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
					</ListView.Resources>
					<ListView.ItemsPanel>
						<ItemsPanelTemplate>
							<StackPanel />
						</ItemsPanelTemplate>
					</ListView.ItemsPanel>
					<ListView.ItemTemplate>
						<DataTemplate>
							<Border Height="85" CornerRadius="5" Background="White" Margin="3" BorderThickness="1" BorderBrush="Black">
								<Grid>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="*" />
									</Grid.ColumnDefinitions>
									<Grid.RowDefinitions>
										<RowDefinition Height="Auto" />
										<RowDefinition Height="Auto" />
										<RowDefinition Height="Auto" />
									</Grid.RowDefinitions>
									<TextBlock Margin="5 5 5 3" FontWeight="Bold">
										<TextBlock.Text>
											<MultiBinding StringFormat="{}{0} vom {1:dd.MM.yyyy} an {2} {3}">
												<MultiBinding.Bindings>
													<Binding Path="InvoiceNumber" />
													<Binding Path="InvoiceDate" />
													<Binding Path="RecipientPersonFirstName" />
													<Binding Path="RecipientPersonLastName" />
												</MultiBinding.Bindings>
											</MultiBinding>
										</TextBlock.Text>
									</TextBlock>
									<TextBlock Margin="5 0 0 0" Grid.Row="1" Grid.ColumnSpan="2">
										<TextBlock.Text>
											<MultiBinding StringFormat="Abrechnungszeitraum: {0:dd.MM.yyyy} - {1:dd.MM.yyyy}">
												<MultiBinding.Bindings>
													<Binding Path="AccountingPeriodStart" />
													<Binding Path="AccountingPeriodEnd" />
												</MultiBinding.Bindings>
											</MultiBinding>
										</TextBlock.Text>
									</TextBlock>
									<TextBlock HorizontalAlignment="Right" VerticalAlignment="Center" FontWeight="Bold" Margin="0 5 5 0" Height="50" FontSize="14" Text="{Binding TotalAmount, Mode=OneWay, StringFormat=\{0:0.00\} €}" Grid.Column="2" Grid.RowSpan="2"></TextBlock>
									<Button Grid.Column="2" Grid.Row="2" Width="32" Height="22" HorizontalAlignment="Right" Margin="0,0,75,5" Style="{DynamicResource GlassButton}">
										<TextBlock>
											<Hyperlink TargetName="_NewWindow" Foreground="#FFFFFFFF" NavigateUri="{Binding Converter={StaticResource InvoiceBaseDCPrintURLConverter}}" RequestNavigate="Hyperlink_OnRequestNavigate">
												<Grid Width="32" Margin="-3 0" Height="22">
													<Rectangle Fill="White" Opacity=".01" />
													<TextBlock Text="¥" Foreground="#2d4d82" Margin="6 1 0 0" FontSize="18" FontFamily="Webdings" />
												</Grid>
											</Hyperlink>
										</TextBlock>
									</Button>
									<Button x:Name="btnEdit" Click="bt_edit_Click" Grid.Column="2" Grid.Row="2" Width="32" Height="22" HorizontalAlignment="Right" Margin="0,0,40,5" BorderThickness="1,1,1,1" Padding="1,1,1,1" Style="{DynamicResource GlassButton}" Tag="{Binding}" Visibility="{Binding EditAllowed, Converter={StaticResource BoolVisibilityConverter}}">
										<Image Source="..\..\..\Ressources\Icons\Symbol Edit.png" Stretch="Uniform" Margin="1,1,1,1" />
									</Button>
									<Button x:Name="btnDelete" Grid.Column="2" Grid.Row="2" Click="bt_delete_Click" Width="32" Height="22" HorizontalAlignment="Right" Margin="0,0,5,5" Padding="1,1,1,1" BorderThickness="1,1,1,1" Style="{DynamicResource GlassButton}" Tag="{Binding}" Visibility="{Binding EditAllowed, Converter={StaticResource BoolVisibilityConverter}}">
										<Image Source="..\..\..\Ressources\Icons\Symbol Delete.png" Stretch="Uniform" Margin="1,1,1,1" />
									</Button>
								</Grid>
							</Border>
						</DataTemplate>
					</ListView.ItemTemplate>
				</ListView>
			</Grid>
		</GroupBox>
	</Grid>
</localView:BeWoView>