123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684 |
- <Window
- x:Class="XHWK.WKTool.DeviceWindow"
- 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:gif="http://wpfanimatedgif.codeplex.com"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:view="clr-namespace:XHWK.WKTool.View"
- Title="设备检测"
- Width="569"
- Height="367"
- ShowInTaskbar="True"
- Style="{StaticResource ZWinStyle}"
- WindowStartupLocation="CenterScreen"
- WindowStyle="SingleBorderWindow"
- mc:Ignorable="d">
-
- <Window.Resources>
- <!-- 摄像头样式 -->
- <Style x:Key="StlToggleButton" TargetType="ToggleButton">
- <Setter Property="Foreground" Value="White" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <Border
- x:Name="Back"
- Background="#FFFFFFFF"
- BorderBrush="Transparent"
- BorderThickness="0">
- <Path
- Name="PathFill"
- Width="8"
- Height="6"
- Data="M5,0 L10,10 L0,10 z"
- Fill="Black"
- RenderTransformOrigin="0.5,0.5"
- Stretch="Fill"
- StrokeThickness="0">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform Angle="180" />
- <TranslateTransform />
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="PathFill" Property="Fill" Value="White" />
- <Setter TargetName="Back" Property="Background" Value="#FFDCDCDC" />
- <Setter TargetName="Back" Property="BorderBrush" Value="#FFDCDCDC" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="StlComboBox" TargetType="ComboBox">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
- <Setter Property="ScrollViewer.CanContentScroll" Value="True" />
- <Setter Property="HorizontalAlignment" Value="Left" />
- <Setter Property="Foreground" Value="Black" />
- <Setter Property="Height" Value="30" />
- <Setter Property="Margin" Value="0,0,0,0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ComboBox">
- <Grid Background="#F7FDF7">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.8*" />
- <ColumnDefinition Width="0.2*" MaxWidth="20" />
- </Grid.ColumnDefinitions>
- <TextBox
- Grid.Column="0"
- VerticalContentAlignment="Center"
- IsReadOnly="True"
- Text="{TemplateBinding Text}" />
- <Border
- Grid.Column="0"
- BorderBrush="#FFDCDCDC"
- BorderThickness="1,1,1,1"
- CornerRadius="1,0,0,1" />
- <Border
- Grid.Column="1"
- BorderBrush="#FFDCDCDC"
- BorderThickness="0,1,1,1"
- CornerRadius="0,1,1,0">
- <ToggleButton
- ClickMode="Press"
- IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
- Style="{StaticResource StlToggleButton}" />
- </Border>
- <Popup
- x:Name="Popup"
- Grid.Column="0"
- AllowsTransparency="True"
- Focusable="False"
- IsOpen="{TemplateBinding IsDropDownOpen}"
- Placement="Bottom"
- PopupAnimation="Slide">
- <Border
- x:Name="DropDown"
- MinWidth="{TemplateBinding ActualWidth}"
- MaxHeight="{TemplateBinding MaxDropDownHeight}"
- CornerRadius="1"
- SnapsToDevicePixels="True">
- <Border.Effect>
- <DropShadowEffect
- BlurRadius="2"
- Opacity="0.5"
- ShadowDepth="0"
- Color="Black" />
- </Border.Effect>
- <ScrollViewer
- MaxHeight="{TemplateBinding MaxDropDownHeight}"
- Margin="4,6,4,6"
- CanContentScroll="True"
- HorizontalScrollBarVisibility="Auto"
- SnapsToDevicePixels="True"
- Style="{DynamicResource ScrollViewerStyle}"
- VerticalScrollBarVisibility="Auto">
- <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel
- Background="White"
- IsItemsHost="True"
- KeyboardNavigation.DirectionalNavigation="Contained" />
- </ScrollViewer>
- </Border>
- </Popup>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Window.Resources>
- <Grid Background="White">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid
- x:Name="GridTitleBlack"
- Grid.Row="0"
- Margin="0,0"
- Background="#3f6fff"
- MouseLeftButtonDown="Window_MouseLeftButtonDown">
- <TextBlock
- Grid.RowSpan="2"
- Margin="16,0,0,0"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="White"
- Text="设备检测" />
- <Button
- x:Name="BtnDownBlack"
- Grid.Row="0"
- Width="46"
- HorizontalAlignment="Right"
- Click="BtnDown_Click"
- Content="×"
- Cursor="Hand"
- FontSize="30"
- Foreground="White" />
- </Grid>
- <Grid Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="140" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0">
- <Border BorderBrush="#FFE9E9E9" BorderThickness="0,0,1,0">
- <StackPanel Margin="0,10" VerticalAlignment="Top">
- <Button
- x:Name="BtnCamera"
- Height="40"
- Margin="0,0,0,0"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- IsEnabled="False">
- <StackPanel Orientation="Horizontal">
- <Image
- Height="18"
- Margin="6,0"
- HorizontalAlignment="Left"
- Source="/BlackImages/Device_Camera.png" />
- <TextBlock
- Width="100"
- Padding="0,0,0,0"
- HorizontalAlignment="Center"
- FontSize="16"
- Text="摄像头" />
- </StackPanel>
- </Button>
- <Button
- x:Name="BtnSpeaker"
- Height="40"
- Margin="0,0,0,0"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- IsEnabled="False">
- <StackPanel Orientation="Horizontal">
- <Image
- Height="18"
- Margin="6,0"
- HorizontalAlignment="Left"
- Source="/BlackImages/Device_Voice.png" />
- <TextBlock
- Width="100"
- Padding="0,0,0,0"
- HorizontalAlignment="Center"
- FontSize="16"
- Text="扬声器" />
- </StackPanel>
- </Button>
- <Button
- x:Name="BtnMicrophone"
- Height="40"
- Margin="0,0,0,0"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Cursor="Hand"
- IsEnabled="False">
- <StackPanel Orientation="Horizontal">
- <Image
- Height="18"
- Margin="6,0"
- HorizontalAlignment="Left"
- Source="/BlackImages/Device_Microphone.png" />
- <TextBlock
- Width="100"
- Padding="0,0,0,0"
- HorizontalAlignment="Center"
- FontSize="16"
- Text="麦克风" />
- </StackPanel>
- </Button>
- <Button
- x:Name="BtnDetectionPage"
- Height="40"
- Margin="0,0,0,0"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- IsEnabled="False">
- <StackPanel Orientation="Horizontal">
- <Image
- Height="18"
- Margin="6,0"
- HorizontalAlignment="Left"
- Source="/BlackImages/Device_JC.png" />
- <TextBlock
- Width="100"
- Padding="0,0,0,0"
- HorizontalAlignment="Center"
- FontSize="16"
- Text="检测结果" />
- </StackPanel>
- </Button>
- </StackPanel>
- </Border>
- </Grid>
-
- <Grid
- x:Name="GridCamera"
- Grid.Column="1"
- Visibility="Visible">
- <Grid.RowDefinitions>
- <RowDefinition Height="64" />
- <RowDefinition Height="*" />
- <RowDefinition Height="64" />
- </Grid.RowDefinitions>
- <StackPanel
- Grid.Row="0"
- Margin="30,0,0,0"
- Orientation="Horizontal">
- <TextBlock
- Margin="0,5,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF000000"
- Text="摄像头" />
- <ComboBox
- x:Name="CmbCameraList"
- Width="236"
- Margin="16,0,0,0"
- Padding="30,0,0,0"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Background="White"
- BorderThickness="0"
- Cursor="Hand"
- DisplayMemberPath="Name"
- FontSize="14"
- SelectionChanged="CmbCameraList_SelectionChanged"
- Style="{StaticResource StlComboBox}"
- Text="请选择" />
- </StackPanel>
- <Grid
- Grid.Row="1"
- Width="300"
- Height="160"
- Margin="30,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Top">
- <Image
- x:Name="ImgPlayer"
- RenderTransformOrigin="0.5,0.5"
- Stretch="Fill"
- Visibility="Visible">
- <Image.RenderTransform>
- <ScaleTransform ScaleX="-1" />
- </Image.RenderTransform>
- </Image>
- </Grid>
- <StackPanel
- Grid.Row="2"
- Margin="30,0,0,0"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
- <Button
- x:Name="BtnCameraGood"
- Width="100"
- Height="30"
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Background="#3f6fff"
- Click="btn_camera_good_Click"
- Content="可以看见"
- Cursor="Hand"
- FontSize="15"
- Foreground="White"
- IsDefault="True" />
- <Button
- x:Name="BtnCameraBad"
- Width="100"
- Height="30"
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Background="#F1F2F3"
- Click="btn_camera_bad_Click"
- Content="看不见"
- Cursor="Hand"
- FontSize="15"
- Foreground="#333333"
- IsDefault="True" />
- </StackPanel>
- </Grid>
- <Grid
- x:Name="GridSpeaker"
- Grid.Column="1"
- Visibility="Collapsed">
- <Grid.RowDefinitions>
- <RowDefinition Height="64" />
- <RowDefinition Height="*" />
- <RowDefinition Height="64" />
- </Grid.RowDefinitions>
- <Grid Grid.Row="0">
- <StackPanel
- Margin="30,20,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- Orientation="Horizontal">
- <Button
- x:Name="BtnSpeakerDetection"
- Width="100"
- Height="30"
- Margin="0"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Click="BtnSpeakerDetection_Click"
- Content="播放音频"
- Cursor="Hand"
- FontSize="15"
- Foreground="White"
- IsDefault="True">
- <Button.Template>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="1"
- CornerRadius="7">
- <Border.Background>
- <Brush>#3f6fff</Brush>
- </Border.Background>
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}" />
- </Border>
- </ControlTemplate>
- </Button.Template>
- </Button>
-
- <MediaElement
- x:Name="MediaAudio"
- Width="0"
- LoadedBehavior="Manual"
- MediaEnded="MediaAudio_MediaEnded"
- MediaOpened="MediaAudio_MediaOpened"
- Stretch="Fill"
- Visibility="Hidden"
- Volume="1" />
- </StackPanel>
- </Grid>
- <Grid Grid.Row="1">
-
- <Grid
- Width="300"
- Height="100"
- Margin="30,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- Background="#FFF1F2F8">
- <Image
- x:Name="ImgAcousticWave"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- gif:ImageBehavior.AnimatedSource="/SkinImages/Other/Dev_AcousticWave2.gif"
- gif:ImageBehavior.AutoStart="True"
- gif:ImageBehavior.RepeatBehavior="Forever"
- Visibility="Hidden" />
- </Grid>
- </Grid>
- <Grid Grid.Row="2">
- <StackPanel
- Margin="30,0,0,0"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
- <Button
- x:Name="BtnSpeakerGood"
- Width="100"
- Height="30"
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Background="#3f6fff"
- Click="btn_speaker_good_Click"
- Content="可以听见"
- Cursor="Hand"
- FontSize="15"
- Foreground="White"
- IsDefault="True" />
- <Button
- x:Name="BtnSpeakerBad"
- Width="100"
- Height="30"
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Background="#F1F2F3"
- Click="btn_speaker_bad_Click"
- Content="听不见"
- Cursor="Hand"
- FontSize="15"
- Foreground="#333333"
- IsDefault="True" />
- </StackPanel>
- </Grid>
- </Grid>
- <Grid
- x:Name="GridMicrophone"
- Grid.Column="1"
- Visibility="Collapsed">
- <Grid.RowDefinitions>
- <RowDefinition Height="64" />
- <RowDefinition Height="*" />
- <RowDefinition Height="64" />
- </Grid.RowDefinitions>
- <StackPanel
- Grid.Row="0"
- Margin="30,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <TextBlock
- Margin="0,5,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- FontSize="16"
- Foreground="#FF000000"
- Text="麦克风" />
- <ComboBox
- x:Name="CmbMicrophoneList"
- Width="236"
- Margin="16,0,0,0"
- Padding="30,0,0,0"
- VerticalAlignment="Top"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Background="White"
- BorderThickness="0"
- Cursor="Hand"
- DisplayMemberPath="Value"
- FontSize="14"
- SelectedValuePath="Key"
- SelectionChanged="CmbMicrophoneList_SelectionChanged"
- Style="{StaticResource StlComboBox}"
- Text="请选择" />
-
- <Button
- x:Name="MicrophoneSetting"
- Width="60"
- Margin="20,0,0,0"
- Background="#3f6fff"
- Content="设置"
- FontSize="14"
- Foreground="White" />
- </StackPanel>
-
- <Grid Grid.Row="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="64" />
- </Grid.RowDefinitions>
- <view:ZClippingBorder
- x:Name="GridMicImg"
- Width="300"
- Height="20"
- Margin="30,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- Background="#FFF1F2F8"
- ClipToBounds="True"
- CornerRadius="10"
- Visibility="Visible">
- <ProgressBar
- x:Name="VolumeProgressBar"
- BorderThickness="0"
- Maximum="100" />
- </view:ZClippingBorder>
- </Grid>
-
- <Grid Grid.Row="2">
- <StackPanel
- Margin="30,0,0,0"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
- <Button
- x:Name="BtnMicrophoneGood"
- Width="100"
- Height="30"
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Background="#3f6fff"
- Click="btn_microphone_good_Click"
- Content="可以看见"
- Cursor="Hand"
- FontSize="15"
- Foreground="White"
- IsDefault="True" />
- <Button
- x:Name="BtnMicrophoneBad"
- Width="100"
- Height="30"
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Background="#F1F2F3"
- Click="btn_microphone_bad_Click"
- Content="看不见"
- Cursor="Hand"
- FontSize="15"
- Foreground="#333333"
- IsDefault="True" />
- </StackPanel>
- </Grid>
- </Grid>
- <Grid
- x:Name="GridDetection"
- Grid.Column="1"
- Margin="25,15"
- Visibility="Collapsed">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50*" />
- <ColumnDefinition Width="50*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="50*" />
- <RowDefinition Height="50*" />
- <RowDefinition Height="50*" />
- <RowDefinition Height="50*" />
- <RowDefinition Height="50*" />
- <RowDefinition Height="50*" />
- <RowDefinition Height="50*" />
- </Grid.RowDefinitions>
- <Grid Grid.Row="0" Grid.Column="0">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF999999"
- Text="设备名称" />
- </Grid>
- <Grid Grid.Row="0" Grid.Column="1">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF999999"
- Text="检测结果" />
- </Grid>
- <!-- 摄像头 -->
- <Grid Grid.Row="1" Grid.Column="0">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF000000"
- Text="摄像头" />
- </Grid>
- <Grid Grid.Row="1" Grid.Column="1">
- <TextBlock
- x:Name="TxbCamera"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF000000"
- Text="" />
- </Grid>
- <!-- 扬声器 -->
- <Grid Grid.Row="2" Grid.Column="0">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF000000"
- Text="扬声器" />
- </Grid>
- <Grid Grid.Row="2" Grid.Column="1">
- <TextBlock
- x:Name="TxbSpeaker"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF000000"
- Text="" />
- </Grid>
- <!-- 麦克风 -->
- <Grid Grid.Row="3" Grid.Column="0">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF000000"
- Text="麦克风" />
- </Grid>
- <Grid Grid.Row="3" Grid.Column="1">
- <TextBlock
- x:Name="TxbMicrophone"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FF000000"
- Text="" />
- </Grid>
-
- <Grid Grid.Row="6" Grid.Column="1">
- <Button
- x:Name="BtnDetection"
- Width="116"
- Height="30"
- Margin="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Stretch"
- Background="#3f6fff"
- Click="BtnDetection_Click"
- Content="重新检测"
- Cursor="Hand"
- FontSize="14"
- Foreground="White"
- IsDefault="True" />
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </Window>
|