<Window x:Class="parkMonitor.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:local="clr-namespace:parkMonitor"
        xmlns:view="clr-namespace:parkMonitor.view"
		xmlns:supUI="clr-namespace:com.superscene.ui"
        xmlns:util="clr-namespace:parkMonitor.view.util"
        xmlns:vm="clr-namespace:parkMonitor.viewModel"
        xmlns:lng="clr-namespace:parkMonitor.language"
        mc:Ignorable="d"
		Name="win"
		WindowState="Maximized"
		WindowStyle="None"
        Title="{lng:LngBind autoPackSys}" Height="700" Width="1200" Closed="win_Closed" WindowStartupLocation="CenterScreen">
	<Window.Resources>
		<ResourceDictionary>
			<vm:DesignMainWinVM x:Key="designVM"/>
			<GridLength x:Key="colWidthName">20</GridLength>
			<GridLength x:Key="colWidthValue">*</GridLength>
		</ResourceDictionary>
	</Window.Resources>

	<Grid Background="#727272" Name="grdRoot">
		<Grid Name="grdMain">
			<Grid.RowDefinitions>
				<RowDefinition Height="{Binding ShowHeight,ElementName=menuMain}"/>
				<RowDefinition Height="8"/>
				<RowDefinition Height="318*"/>
				<RowDefinition Height="8"/>
				<RowDefinition Height="20"/>
			</Grid.RowDefinitions>

			<Border Margin="8,0" CornerRadius="8" Background="#4c4c4c" Grid.Row="2"/>

			<Grid Margin="8,0" Grid.Row="2">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="600" MinWidth="150" MaxWidth="1080"/>
					<ColumnDefinition Width="8"/>
					<ColumnDefinition Width="524*"/>
					<ColumnDefinition Width="8"/>
					<ColumnDefinition Width="200" MinWidth="150" MaxWidth="500"/>
				</Grid.ColumnDefinitions>

				<!--设备/部件树-->
				<Grid>
					<!--<ComboBox VerticalAlignment="Top" Height="30"/>-->
					<!--<TreeViewItem Style="{DynamicResource TreeViewItemStyle1}"/>-->
					<Grid Margin="0,0,0,0" Name="grdTreeList">
						<Border CornerRadius="8" BorderBrush="#6ceff7" BorderThickness="2"/>
						<UserControl d:DataContext="{StaticResource designVM}" Margin="8">
							<UserControl.Style>
								<Style TargetType="UserControl">
									<Setter Property="Template">
										<Setter.Value>
											<ControlTemplate>
												<Grid>
													<Label Foreground="#fff" VerticalAlignment="Top" Content="{lng:LngBind devList}"/>
													<Grid Margin="0,0,0,0" Background="Transparent" HorizontalAlignment="Right" VerticalAlignment="Top" Width="30" Height="30" Cursor="Hand" Name="grdDevTreeType" MouseLeftButtonUp="grdDevTreeType_MouseLeftButtonUp">
														<Image Width="15" Source="/parkMonitor;component/resource/image/treeBox.png" Name="imgDevTreeList" />
														<Image Width="15" Visibility="Collapsed" Source="/parkMonitor;component/resource/image/treeList.png" Name="imgDevTreeBox" />
													</Grid>
													<util:TreeListBox Margin="0,30,0,0" BorderBrush="#fff" BorderThickness="0,1,0,0" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding LstObjectTree}" x:Name="treeObjectInfo" SelectedItemChanged="treeObjectInfo_SelectedItemChanged"/>
													<util:DevTreeListBox Margin="0,30,0,0" Visibility="Collapsed" BorderBrush="#fff" BorderThickness="0,1,0,0" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding LstObjectTree}" x:Name="devTreeObjectInfo" SelectedItemChanged="treeObjectInfo_SelectedItemChanged"/>
												</Grid>
												<ControlTemplate.Triggers>
													<Trigger Property="IsMouseOver" SourceName="grdDevTreeType" Value="True">
														<Setter Property="Background" TargetName="grdDevTreeType" Value="#636363"/>
													</Trigger>
													<DataTrigger Binding="{Binding IsDevTreeShowList}" Value="False">
														<Setter Property="Visibility" TargetName="imgDevTreeList" Value="Collapsed"/>
														<Setter Property="Visibility" TargetName="imgDevTreeBox" Value="Visible"/>
														<Setter Property="Visibility" TargetName="treeObjectInfo" Value="Collapsed"/>
														<Setter Property="Visibility" TargetName="devTreeObjectInfo" Value="Visible"/>
													</DataTrigger>
												</ControlTemplate.Triggers>
											</ControlTemplate>
										</Setter.Value>
									</Setter>
								</Style>
							</UserControl.Style>
						</UserControl>
					</Grid>
				</Grid>

				<GridSplitter Grid.Column="1" Background="Transparent" HorizontalAlignment="Stretch"/>

				<Grid Grid.Column="2" >
					<Grid.RowDefinitions>
						<RowDefinition Height="*"/>
						<RowDefinition Height="8"/>
						<RowDefinition Height="450"/>
					</Grid.RowDefinitions>

					<!--主监控面板-->
					<Grid Name="grdPanel">
						<Viewbox MaxWidth="1000">
							<Canvas Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" Height="500" Width="750">
								<Image Source="/parkMonitor;component/resource/image/map/back.png"/>

								<util:RotateLabel Foreground="#fff" FontSize="11" Angle="21" Canvas.Left="450" Canvas.Top="77"  Content="{lng:LngBind webServer}"/>
								<util:RotateLabel Foreground="#fff" FontSize="11" Angle="36" Canvas.Left="133" Canvas.Top="126"  Content="{lng:LngBind numMachinePort}"/>
								<util:RotateLabel Foreground="#fff" FontSize="11" Angle="36" Canvas.Left="207" Canvas.Top="179" Content="{lng:LngBind measurePort}"/>
								<util:RotateLabel Foreground="#fff" FontSize="11" Angle="36" Canvas.Left="301" Canvas.Top="244" Content="{lng:LngBind trayPort}"/>
								<util:RotateLabel Foreground="#fff" FontSize="11" Angle="36" Canvas.Left="566" Canvas.Top="431" Content="{lng:LngBind robotPort}"/>
								<util:RotateLabel Foreground="#fff" FontSize="11" Angle="50" Canvas.Left="116" Canvas.Top="387" Content="{lng:LngBind garage}"/>

								<util:DevInfoPanel Visibility="Collapsed" LinePos="160, 40" Canvas.Left="274" Canvas.Top="8" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.WebServer}" x:Name="pnlWebServer"/>
								<util:DevInfoPanel Visibility="Visible" LinePos="-60, -10" Canvas.Left="428" Canvas.Top="109" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.CentralStatus}" x:Name="pnlCentral"/>
                                <util:DevInfoPanel Visibility="Visible" LinePos="-60, 80" Canvas.Left="193" Canvas.Top="8" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.NumMachine}" x:Name="pnlNum"/>
                                <util:DevInfoPanel Visibility="Visible" LinePos="20, -190" Canvas.Left="219" Canvas.Top="334" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.Laser}" x:Name="pnlLaser"/>
								<util:DevInfoPanel Visibility="Visible" LinePos="5, -140" Canvas.Left="318" Canvas.Top="338" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.Tray}" x:Name="pnlTray"/>
								<util:DevInfoPanel Visibility="Visible" LinePos="-110, 185" Canvas.Left="538" Canvas.Top="72" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.Robot}" x:Name="pnlRobot"/>
								<util:DevInfoPanel Visibility="Collapsed" LinePos="-40, 145" Canvas.Left="538" Canvas.Top="169" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.Raster}" x:Name="pnlRaster"/>
								<util:DevInfoPanel Visibility="Visible" LinePos="-55, 180" Canvas.Left="638" Canvas.Top="169" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.Ultrasonic}" x:Name="pnlUltrasonic"/>
								<util:DevInfoPanel Visibility="Collapsed" LinePos="60, 100" Canvas.Left="23" Canvas.Top="130" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.Garage}" x:Name="pnlGarage"/>
								<util:DevInfoPanel Visibility="Collapsed" LinePos="-60, -100" Canvas.Left="219" Canvas.Top="426" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding panel.Car}" x:Name="pnlCar"/>

								<!--<Image Width="45" Source="/parkMonitor;component/resource/image/map/pc.png" Canvas.Left="428" Canvas.Top="29"/>-->
								<Image Width="25" Source="/parkMonitor;component/resource/image/map/mobile.png" Canvas.Left="478"/>

								<util:ImageButton Width="45" Foreground="#fff" Content="{lng:LngBind webServer}" Source="/parkMonitor;component/resource/image/map/monitor.png" LightSource="/parkMonitor;component/resource/image/map/monitor_slt.png" Canvas.Left="428" Canvas.Top="29"/>
								<util:ImageButton Width="60" Foreground="#fff" Content="{lng:LngBind central}" Source="/parkMonitor;component/resource/image/map/monitor.png" LightSource="/parkMonitor;component/resource/image/map/monitor_slt.png" Canvas.Left="353" Canvas.Top="72"/>
								<util:ImageButton Width="60" Foreground="#fff" Content="{lng:LngBind numMachine}" Source="/parkMonitor;component/resource/image/map/numMachine.png" LightSource="/parkMonitor;component/resource/image/map/numMachine_slt.png" Canvas.Left="109" Canvas.Top="65"/>
								<util:ImageButton Width="60" Foreground="#fff" Content="{lng:LngBind laser}" Source="/parkMonitor;component/resource/image/map/laser.png" LightSource="/parkMonitor;component/resource/image/map/laser_slt.png" Canvas.Left="205" Canvas.Top="120"/>
								<util:ImageButton Width="60" Foreground="#fff" Content="{lng:LngBind tray}" Source="/parkMonitor;component/resource/image/map/tray.png" LightSource="/parkMonitor;component/resource/image/map/tray_slt.png" Canvas.Left="291" Canvas.Top="176"/>
								<util:ImageButton Width="50" Foreground="#fff" Content="{lng:LngBind robot}" Source="/parkMonitor;component/resource/image/map/robot.png" LightSource="/parkMonitor;component/resource/image/map/robot_slt.png" Canvas.Left="399" Canvas.Top="237"/>
								<util:ImageButton Width="40" Foreground="#fff" Content="{lng:LngBind garage}" Source="/parkMonitor;component/resource/image/map/garage.png" LightSource="/parkMonitor;component/resource/image/map/garage_slt.png" Canvas.Left="69" Canvas.Top="211"/>
								<util:ImageButton Width="70" Foreground="#fff" Content="{lng:LngBind car}" Source="/parkMonitor;component/resource/image/map/car.png" LightSource="/parkMonitor;component/resource/image/map/car_slt.png" Canvas.Left="121" Canvas.Top="296"/>

								<util:ImageButton Width="50" Foreground="#fff" Content="{lng:LngBind raster}" Source="/parkMonitor;component/resource/image/map/raster.png" LightSource="/parkMonitor;component/resource/image/map/raster_slt.png" RenderTransformOrigin="0.5,0.5" Canvas.Left="473" Canvas.Top="287"/>
								<util:ImageButton Width="50" Foreground="#fff" Content="{lng:LngBind ultrasonic}" Source="/parkMonitor;component/resource/image/map/ultrasonic.png" LightSource="/parkMonitor;component/resource/image/map/ultrasonic_slt.png" RenderTransformOrigin="0.5,0.5" Canvas.Left="546" Canvas.Top="338"/>
							</Canvas>
						</Viewbox>
					</Grid>
					
					<!--视图-->
					<Grid Visibility="Collapsed" Name="grdView">
						
					</Grid>

					<GridSplitter Grid.Row="1" Background="Transparent" HorizontalAlignment="Stretch"/>

					<!--日志-->
					<Grid Grid.Row="2">
						<Grid>
							<Grid Margin="0,0,0,0">
								<Border CornerRadius="8" BorderBrush="#6ceff7" BorderThickness="2"/>
								<Grid Margin="8">
									<Label Foreground="#fff" VerticalAlignment="Top" Content="{lng:LngBind log}"/>
									<TextBox Visibility="Collapsed" Margin="0,25,0,0" IsReadOnly="False" Background="Transparent" Foreground="#fff" CaretBrush="#fff" BorderThickness="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" d:DataContext="{StaticResource designVM}" Text="{Binding LogInfo}" Name="txtLog" PreviewKeyDown="txtLog_PreviewKeyDown"/>
									<RichTextBox Margin="0,25,0,0" IsReadOnly="True" Background="Transparent" Foreground="#fff" CaretBrush="#fff" BorderThickness="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Name="rtxtLog"/>
								</Grid>
							</Grid>
						</Grid>
					</Grid>
				</Grid>

				<GridSplitter Grid.Column="3" Background="Transparent" HorizontalAlignment="Stretch"/>

				<!--详细信息-->
				<Grid Grid.Column="4" Margin="0,0,0,0">
					<!--<ComboBox VerticalAlignment="Top" Height="30"/>-->
					<!--<TreeViewItem Style="{DynamicResource TreeViewItemStyle1}"/>-->
					<Border CornerRadius="8" BorderBrush="#6ceff7" BorderThickness="2"/>
					<Grid Margin="8">
						<Grid.RowDefinitions>
							<RowDefinition Height="*"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<Label Foreground="#fff" VerticalAlignment="Top" Content="{lng:LngBind detail}"/>
						<util:DevDetail Margin="0,25,0,0" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding DevInfoDetail}" x:Name="lstDetailInfo" ClickWrite="lstDetailInfo_ClickWrite" ClickReset="lstDetailInfo_ClickReset"/>
						<StackPanel Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Center" Orientation="Horizontal">
							<!--复位按钮-->
							<Label Foreground="#fff" Background="#636363" Visibility="Collapsed" Cursor="Hand" Width="70" Margin="0,8,8,0" Height="32" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="{lng:LngBind reset}" Name="btnReset" MouseLeftButtonUp="btnReset_MouseLeftButtonUp"/>
						</StackPanel>
					</Grid>
				</Grid>
				<!--报警信息-->
				<!--<Grid Grid.Column="4" Height="190" VerticalAlignment="Bottom">
					<Border CornerRadius="8" BorderBrush="#6ceff7" BorderThickness="2"/>
					<Grid Margin="8">
						<Label Foreground="#fff" VerticalAlignment="Top" Content="{lng:LngBind alarmInfo}"/>
						<util:AlarmInfo Margin="0,25,0,0" d:DataContext="{StaticResource designVM}" ItemsSource="{Binding AlarmInfo}"/>
					</Grid>
				</Grid>-->
			</Grid>

			<!--菜单-->
			<util:MenuBox Grid.RowSpan="3" d:DataContext="{StaticResource designVM}" x:Name="menuMain"/>

			<!--关闭按钮-->
			<Grid Width="35" Height="25" HorizontalAlignment="Right" VerticalAlignment="Top" Cursor="Hand" Name="btnClose" MouseLeftButtonUp="btnClose_MouseLeftButtonUp">
				<Path StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" Name="pathClose">
					<Path.Data>
						<GeometryGroup>
							<LineGeometry StartPoint="0,0" EndPoint="10,10"/>
							<LineGeometry StartPoint="10,0" EndPoint="0,10"/>
						</GeometryGroup>
					</Path.Data>
					<Path.Style>
						<Style>
							<Setter Property="Path.Stroke" Value="#fff"/>
							<Style.Triggers>
								<DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Grid}}}" Value="True">
									<Setter Property="Path.Stroke" Value="#fff"/>
								</DataTrigger>
							</Style.Triggers>
						</Style>
					</Path.Style>
				</Path>
				<Grid.Style>
					<Style TargetType="{x:Type Grid}">
						<Setter Property="Grid.Background" Value="Transparent"/>
						<Style.Triggers>
							<Trigger Property="Grid.IsMouseOver" Value="True">
								<Setter Property="Grid.Background" Value="#e81123" />
							</Trigger>
						</Style.Triggers>
					</Style>
				</Grid.Style>
			</Grid>

		</Grid>
	</Grid>
</Window>
