157 lines
9.1 KiB
XML
157 lines
9.1 KiB
XML
<Window x:Class="AnQing.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:hc="https://handyorg.github.io/handycontrol"
|
||
xmlns:viewmodel="clr-namespace:AnQing.ViewModel"
|
||
xmlns:local_index="clr-namespace:AnQing.Commons"
|
||
xmlns:local="clr-namespace:AnQing"
|
||
mc:Ignorable="d" Loaded="Window_Loaded" Closing="Window_Closing"
|
||
Title="MainWindow" Height="800
|
||
" Width="1100">
|
||
<Window.Resources>
|
||
<Style TargetType="Thumb" x:Key="CustomThumbStyle">
|
||
<!-- 设置Thumb的背景 -->
|
||
<Setter Property="Background" Value="Transparent"/>
|
||
<!-- 设置Thumb的边框 -->
|
||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||
<Setter Property="BorderThickness" Value="0"/>
|
||
<!-- 设置Thumb的宽度 -->
|
||
<Setter Property="Height" Value="20"/>
|
||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||
<Setter Property="Cursor" Value="SizeNS"/>
|
||
|
||
<!-- 自定义控件模板 -->
|
||
<Setter Property="Template">
|
||
<Setter.Value>
|
||
<ControlTemplate TargetType="Thumb">
|
||
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
|
||
<Grid>
|
||
<!-- 这里可以定义Thumb的内容 -->
|
||
<Rectangle Fill="Transparent" />
|
||
</Grid>
|
||
</Border>
|
||
</ControlTemplate>
|
||
</Setter.Value>
|
||
</Setter>
|
||
</Style>
|
||
<local_index:IndexConverter x:Key="IndexToSerialNumberConverter" />
|
||
<local_index:RunTextConverter x:Key="RunTextConverter" />
|
||
<local_index:ReadRunTextConverter x:Key="ReadRunTextConverter" />
|
||
<local_index:EllipseFillConverter x:Key="EllipseFillConverter" />
|
||
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||
</Window.Resources>
|
||
<!--<Window.DataContext>
|
||
<viewmodel:MianWindowViewModel></viewmodel:MianWindowViewModel>
|
||
</Window.DataContext>-->
|
||
<Grid Background="#EFF1F3">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="1*"></RowDefinition>
|
||
<RowDefinition Height="100"></RowDefinition>
|
||
</Grid.RowDefinitions>
|
||
<Grid x:Name="Main">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="1*"></RowDefinition>
|
||
<RowDefinition Height="4*"></RowDefinition>
|
||
<RowDefinition Height="1*"></RowDefinition>
|
||
</Grid.RowDefinitions>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||
</Grid.ColumnDefinitions>
|
||
<Border Grid.Column="0" Margin="20,30,20,20" CornerRadius="15" Background="White">
|
||
<TextBlock FontSize="20" FontWeight="Bold" Foreground="#999" VerticalAlignment="Center" HorizontalAlignment="Center">视 觉 摄 像 画 面 ( 一 )</TextBlock>
|
||
</Border>
|
||
<Border Grid.Column="1" Margin="20,30,20,20" CornerRadius="15" Background="White">
|
||
<TextBlock FontSize="20" FontWeight="Bold" Foreground="#999" VerticalAlignment="Center" HorizontalAlignment="Center">视 觉 摄 像 画 面 ( 二 )</TextBlock>
|
||
</Border>
|
||
<Border Grid.Row="1" Grid.Column="0" Margin="20" CornerRadius="15">
|
||
<Border.Style>
|
||
<Style TargetType="Border">
|
||
<Setter Property="Background">
|
||
<Setter.Value>
|
||
<ImageBrush ImageSource="{Binding ImageSource}" />
|
||
</Setter.Value>
|
||
</Setter>
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding ImageSource}" Value="{x:Null}">
|
||
<Setter Property="Background" Value="White"/>
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</Border.Style>
|
||
</Border>
|
||
<Border Grid.Row="1" Grid.Column="1" Margin="20" CornerRadius="15" Background="White">
|
||
<Border.Style>
|
||
<Style TargetType="Border">
|
||
<Setter Property="Background">
|
||
<Setter.Value>
|
||
<ImageBrush ImageSource="{Binding ImageSource}" />
|
||
</Setter.Value>
|
||
</Setter>
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding ImageSource}" Value="{x:Null}">
|
||
<Setter Property="Background" Value="White"/>
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</Border.Style>
|
||
<!--<Image Name="Image_2"></Image>-->
|
||
</Border>
|
||
<Border Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="20" Background="White" CornerRadius="15">
|
||
<Grid>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||
</Grid.ColumnDefinitions>
|
||
<WrapPanel VerticalAlignment="Center">
|
||
<TextBlock Margin="20,0">资产信息:<Run Text="{Binding ReaderText}"></Run></TextBlock>
|
||
<TextBlock Margin="20,0">识别时间:<Run Text="{Binding ReaderTextTime}"></Run></TextBlock>
|
||
</WrapPanel>
|
||
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Column="1">
|
||
<Button Width="100" Height="35" Margin="0,0,30,0" Style="{StaticResource BtnCornerRadius2}" Command="{Binding ButtonGatherCommand}" >触发</Button>
|
||
<Button Width="100" Height="35" Margin="0,0,30,0" Style="{StaticResource BtnCornerRadius2}" Click="Button_Click_2" Visibility="{Binding ReaderState, Converter={StaticResource BoolToVisibilityConverter}}">区域选值</Button>
|
||
</WrapPanel>
|
||
</Grid>
|
||
</Border>
|
||
</Grid>
|
||
|
||
<Grid Name="ToolBar" Grid.Row="1">
|
||
<Border Grid.Row="2" Margin="20,5,20,5" Height="60" Background="White" CornerRadius="15">
|
||
<Grid>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<WrapPanel VerticalAlignment="Center" Grid.Column="0" Margin="20,0">
|
||
<Ellipse Width="20" Height="20" Fill="{Binding Video1State, Converter={StaticResource EllipseFillConverter}}" />
|
||
<TextBlock Margin="10,0,0,0" VerticalAlignment="Center">
|
||
相机1连接状态:
|
||
<Run Foreground="{Binding Video1State, Converter={StaticResource EllipseFillConverter}}" Text="{Binding Video1State, Converter={StaticResource RunTextConverter}}"/>
|
||
</TextBlock>
|
||
<Ellipse Width="20" Margin="30,0,0,0" Height="20" Fill="{Binding Video2State, Converter={StaticResource EllipseFillConverter}}" />
|
||
<TextBlock Margin="10,0,0,0" VerticalAlignment="Center">
|
||
相机2连接状态:
|
||
<Run Foreground="{Binding Video2State, Converter={StaticResource EllipseFillConverter}}" Text="{Binding Video2State, Converter={StaticResource RunTextConverter}}"/>
|
||
</TextBlock>
|
||
</WrapPanel>
|
||
|
||
<WrapPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||
<Button Width="100" Height="35" Margin="0,0,30,0" Style="{StaticResource BtnCornerRadius2}" Command="{Binding ButtonGatherCommand}">触发</Button>
|
||
<!--<Button Width="100" Height="35" Margin="0,0,30,0" Style="{StaticResource BtnCornerRadius2}" Command="{Binding ButtonCloseCommand}">释放</Button>-->
|
||
<Button Width="100" Height="35" Style="{StaticResource BtnCornerRadius}" Click="Button_Click">历史</Button>
|
||
<Button Width="100" Height="35" Margin="30,0,0,0" Style="{StaticResource BtnCornerRadius2}" Click="Button_Click_1">设置</Button>
|
||
</WrapPanel>
|
||
</Grid>
|
||
</Border>
|
||
</Grid>
|
||
|
||
<Grid x:Name="MenuView" Grid.Row="0" Grid.RowSpan="2" Visibility="Collapsed" Background="#EFF1F3">
|
||
|
||
</Grid>
|
||
</Grid>
|
||
</Window>
|