<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"  x:Class="BeWo.View.CostRatePeriodControl" VerticalAlignment="Top" x:Name="UserControl" Background="{x:Null}">
	<UserControl.Resources>
		<DataTemplate x:Key="CostRateItemTemplate">
			<Border BorderThickness="0 1 0 0" BorderBrush="Gray" Margin="0 2 0 0">
				<Grid Grid.Row="2" Grid.ColumnSpan="2" Margin="0 2 0 0">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto" SharedSizeGroup="c1" />
						<ColumnDefinition Width="Auto" SharedSizeGroup="c2" />
						<ColumnDefinition Width="*" />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition Height="Auto" />
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<TextBlock Text="Gültig bis" Margin="0,4,3,0" />
						<dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="1" x:Name="datepicker_validUntil" EditValue="{Binding Path=EndDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="23" />
					</Grid>
                    <dxe:TextEdit Height="23" HorizontalAlignment="Stretch" MaskType="Numeric" MaskUseAsDisplayFormat="True" Grid.Column="1" Margin="3,0,0,0" EditValue="{Binding Path=CostRateValue, UpdateSourceTrigger=PropertyChanged}" 
                                  Mask="########0.00"/>
                    <!--<dxe:TextEdit Height="23" HorizontalAlignment="Stretch" MaskType="Numeric" MaskUseAsDisplayFormat="True" Grid.Column="1" Margin="3,0,0,0" EditValue="{Binding Path=CostRateValue, UpdateSourceTrigger=PropertyChanged}" >
                        <dxe:TextEdit.Mask>
                            <MultiBinding Converter="{StaticResource CostRatePeriodValueConverter}" UpdateSourceTrigger="PropertyChanged">
                                <MultiBinding.Bindings>
                                    <Binding Path="CostRateValue" />
                                    <Binding Path="CostRateType" />
                                </MultiBinding.Bindings>
                            </MultiBinding>
                        </dxe:TextEdit.Mask>
                    </dxe:TextEdit>-->
					
					<TextBlock Padding="0 4 0 0" Height="23" x:Name="lblOldUnitName" Text="{Binding Text, ElementName=lblActualUnitName}" Grid.Row="1" Visibility="{Binding Visibility, ElementName=lblActualUnitName}" />
					<TextBox Height="23" x:Name="txtOldUnitName" Grid.Row="1" Text="{Binding UnitName, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding Visibility, ElementName=lblActualUnitName}" Grid.Column="1" Margin="3,3,0,0" HorizontalAlignment="Stretch" />
					<Button x:Name="button_deleteCostRatePeriod" Grid.RowSpan="2" VerticalAlignment="Bottom" Grid.Column="2" Width="20" Height="20" HorizontalAlignment="Right" Style="{DynamicResource CloseButtonStyle}" Click="button_deleteCostRatePeriod_Click" Margin="3,0,0,3" />
				</Grid>
			</Border>
		</DataTemplate>
	</UserControl.Resources>
	<Grid x:Name="LayoutRoot" Grid.IsSharedSizeScope="True">
		<Border x:Name="border" BorderBrush="#FF6A6A6A" BorderThickness="0" Padding="0">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Grid Margin="3 0">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto" MinWidth="160" SharedSizeGroup="c1" />
						<ColumnDefinition Width="Auto" MinWidth="70" SharedSizeGroup="c2" />
						<ColumnDefinition Width="*" />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition Height="Auto" />
						<RowDefinition Height="Auto" />
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>
					<TextBlock Height="23" x:Name="lblActualValue" Text="Aktueller Stundensatz (€)" Padding="0,4,0,0" />
					<TextBlock Height="23" Padding="0 4 0 0" x:Name="lblActualUnitName" Text="UnitName" Grid.Row="1" Visibility="Collapsed" />
					<TextBlock x:Name="lblValidUntil" Text="(gültig ab 01.01.2009)" Grid.Row="2" Margin="0,-3,0,0" />
					<TextBox Height="23" x:Name="txtActualUnitName" Text="{Binding UnitName, UpdateSourceTrigger=PropertyChanged}" Visibility="Collapsed" Grid.Column="1" Grid.Row="1" Margin="3,3,0,0" HorizontalAlignment="Stretch" />
                    <dxe:TextEdit Height="23" HorizontalAlignment="Stretch" MaskType="Numeric" MaskUseAsDisplayFormat="True" Grid.Column="1" Margin="3,0,0,0" EditValue="{Binding Path=CostRateValue, UpdateSourceTrigger=PropertyChanged}" 
                                  Mask="########0.00"/>
                       
					
					<Button x:Name="button_addCostRatePeriod" HorizontalAlignment="Center" Grid.Column="2" Width="21" Height="21" Margin="3,0,0,0" VerticalAlignment="Center" Click="button_addCostRatePeriod_Click">
						<Grid Width="18" HorizontalAlignment="Center" VerticalAlignment="Center">
							<Line X1="4" X2="12" Y1="8" Y2="8" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
							<Line X1="8" X2="8" Y1="4" Y2="12" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
						</Grid>
					</Button>
				</Grid>
				<ListBox x:Name="listBoxOldValues" IsSynchronizedWithCurrentItem="True" Grid.Row="3" Grid.ColumnSpan="3" Margin="0,3,0,0" BorderBrush="Transparent" BorderThickness="0" ItemTemplate="{DynamicResource CostRateItemTemplate}" Background="{x:Null}">
					<ListBox.ItemContainerStyle>
						<Style TargetType="{x:Type ListBoxItem}">
							<Setter Property="Focusable" Value="false" />
						</Style>
					</ListBox.ItemContainerStyle>
					<ListBox.Resources>
						<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
						<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
					</ListBox.Resources>
				</ListBox>
			</Grid>
		</Border>
	</Grid>
</UserControl>