ListView和Viewbox控件页面布局

<lDataBase:KanbanViewBase
             xmlns:lDataBase="clr-namespace:MES.Plugin.KanBan.LocalData;assembly=Midea.MES.Plugin.KanBan.LocalData"
    x:Class="MES.Plugin.KanBan.Layout.Views.UploadingParking" 
             xmlns:ex="clr-namespace:MES.Plugin.KanBan.Layout.Views.MaterialPushingEx"
             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:ctl="clr-namespace:MES.Plugin.KanBan.Layout.Controls" 
              xmlns:c="clr-namespace:Midea.MES.Plugin.KanBan.Layout.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="1000" FontSize="18">
	<lDataBase:KanbanViewBase.Resources>
		<c:RectangleToRectangleByCount x:Key="RectangleToRectangleByCount"></c:RectangleToRectangleByCount>
		<SolidColorBrush x:Key="backgroupColor" Color="Black"/>
	</lDataBase:KanbanViewBase.Resources>
	<Grid x:Name="root">
		<Grid>
			<Grid.RowDefinitions>
				<RowDefinition Height="50"></RowDefinition>
				<RowDefinition ></RowDefinition>
				<RowDefinition Height="160"></RowDefinition>
			</Grid.RowDefinitions>
			<StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Background="#FF2f3142" >
				<TextBlock Text="当前时间:" Foreground="#fffffb00" VerticalAlignment="Center" FontSize="30" Margin="30,0,0,0"></TextBlock>
				<ctl:UCDateTimeControl></ctl:UCDateTimeControl>
			</StackPanel>
			<Grid Grid.Row="1" Background="#FF909090" Margin="30,0">
				<ListView ItemsSource="{Binding LoadedData}"  Name="lvDefect" VerticalAlignment="Top">
					<ListView.Template>
						<ControlTemplate>
							<Border  CornerRadius="1" BorderBrush="RoyalBlue" BorderThickness="0" >
								<ItemsPresenter />
							</Border>
						</ControlTemplate>
					</ListView.Template>
					<ListView.ItemsPanel>
						<ItemsPanelTemplate>
							<WrapPanel IsItemsHost="True"/>
						</ItemsPanelTemplate>
					</ListView.ItemsPanel>
					<ListView.ItemContainerStyle>
						<Style TargetType="{x:Type ListViewItem}">
							<Setter Property="Template">
								<Setter.Value>
									<ControlTemplate>
										<Border  CornerRadius="5" Margin="0" >
											<Border.Width>
												<MultiBinding  Converter="{StaticResource RectangleToRectangleByCount}"  ConverterParameter="Width">
													<Binding ElementName="root" Path="ActualWidth"/>
													<Binding ElementName="root" Path="ActualHeight"/>
													<Binding ElementName="root" Path="DataContext.CellCount"/>
												</MultiBinding>
											</Border.Width>
											<Border.Height>
												<MultiBinding  Converter="{StaticResource RectangleToRectangleByCount}"  ConverterParameter="Height">
													<Binding ElementName="root" Path="ActualWidth"/>
													<Binding ElementName="root" Path="ActualHeight"/>
													<Binding ElementName="root" Path="DataContext.CellCount"/>
												</MultiBinding>
											</Border.Height>
											<Border Margin="1" Background="{Binding AlertColor}">
												<Border Margin="1" Background="{Binding AlertColor}">
													<Grid>
														<Grid.RowDefinitions>
															<RowDefinition Height="80*"></RowDefinition>
															<RowDefinition Height="40*"></RowDefinition>
														</Grid.RowDefinitions>
														<Grid.ColumnDefinitions>
															<ColumnDefinition Width="10*"></ColumnDefinition>
															<ColumnDefinition Width="10*"></ColumnDefinition>
														</Grid.ColumnDefinitions>
														<Viewbox Margin="1" Grid.Row="0" Grid.ColumnSpan="2">
															<Label  Content="{Binding ParkingLotCode}" Foreground="White" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"></Label>
														</Viewbox>
														<Viewbox Margin="1" Grid.Row="1" Grid.Column="1">
															<Label  Grid.Column="1"  Foreground="White" Content="{Binding CarWaitCNT}" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" ></Label>
														</Viewbox>
														<Viewbox Margin="1" Grid.Row="1" Grid.Column="0" >
															<Image Visibility="{Binding PicVisable}"  Grid.Column="0" Source="/Midea.MES.Plugin.KanBan.Layout;component/Resources/Images/Car.png" HorizontalAlignment="Left"/>
														</Viewbox>
													</Grid>
												</Border>
											</Border>
										</Border>
									</ControlTemplate>
								</Setter.Value>
							</Setter>
						</Style>
					</ListView.ItemContainerStyle>
				</ListView>
			</Grid>
			<Grid Grid.Row="2" Margin="30,0">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="375"></ColumnDefinition>
					<ColumnDefinition Width="50"></ColumnDefinition>
					<ColumnDefinition Width="375"></ColumnDefinition>
					<ColumnDefinition Width="50"></ColumnDefinition>
					<ColumnDefinition Width="375"></ColumnDefinition>
					<ColumnDefinition Width="50"></ColumnDefinition>
					<ColumnDefinition Width="*"></ColumnDefinition>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="*"></RowDefinition>
					<RowDefinition Height="115"></RowDefinition>
					<RowDefinition Height="10"></RowDefinition>
				</Grid.RowDefinitions>
				<Border Background="#197c4b" Grid.Row="1" Grid.Column="0">
					<TextBlock Text="空闲" Foreground="White" FontSize="56" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
				</Border>
				<Border Background="#da860d" Grid.Row="1" Grid.Column="2">
					<TextBlock Text="卸货中" Foreground="White" FontSize="56" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
				</Border>
				<Border Background="#bf2530" Grid.Row="1" Grid.Column="4">
					<TextBlock Text="超时停靠"  Foreground="White" FontSize="56" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
				</Border>
			</Grid>
		</Grid>
	</Grid>
</lDataBase:KanbanViewBase>


你可能感兴趣的:(布局)