星火微课系统客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

DeviceWindow.xaml 40KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. <Window
  2. x:Class="XHWK.WKTool.DeviceWindow"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:gif="http://wpfanimatedgif.codeplex.com"
  7. xmlns:local="clr-namespace:XHWK.WKTool"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. Title="设备检测"
  10. Width="650"
  11. Height="450"
  12. AllowsTransparency="True"
  13. BorderBrush="#FFE9E9E9"
  14. BorderThickness="1"
  15. ShowInTaskbar="False"
  16. WindowStartupLocation="CenterOwner"
  17. WindowStyle="None"
  18. mc:Ignorable="d">
  19. <Window.Resources>
  20. <!-- 摄像头样式 -->
  21. <Style x:Key="stlToggleButton" TargetType="ToggleButton">
  22. <Setter Property="Foreground" Value="White" />
  23. <Setter Property="Template">
  24. <Setter.Value>
  25. <ControlTemplate>
  26. <Border
  27. x:Name="Back"
  28. Background="#FFFFFFFF"
  29. BorderBrush="Transparent"
  30. BorderThickness="0">
  31. <Path
  32. Name="PathFill"
  33. Width="8"
  34. Height="6"
  35. Data="M5,0 L10,10 L0,10 z"
  36. Fill="Black"
  37. RenderTransformOrigin="0.5,0.5"
  38. Stretch="Fill"
  39. StrokeThickness="0">
  40. <Path.RenderTransform>
  41. <TransformGroup>
  42. <ScaleTransform />
  43. <SkewTransform />
  44. <RotateTransform Angle="180" />
  45. <TranslateTransform />
  46. </TransformGroup>
  47. </Path.RenderTransform>
  48. </Path>
  49. </Border>
  50. <ControlTemplate.Triggers>
  51. <Trigger Property="IsMouseOver" Value="True">
  52. <Setter TargetName="PathFill" Property="Fill" Value="White" />
  53. <Setter TargetName="Back" Property="Background" Value="#FFDCDCDC" />
  54. <Setter TargetName="Back" Property="BorderBrush" Value="#FFDCDCDC" />
  55. </Trigger>
  56. </ControlTemplate.Triggers>
  57. </ControlTemplate>
  58. </Setter.Value>
  59. </Setter>
  60. </Style>
  61. <Style x:Key="stlComboBox" TargetType="ComboBox">
  62. <Setter Property="SnapsToDevicePixels" Value="True" />
  63. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
  64. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
  65. <Setter Property="ScrollViewer.CanContentScroll" Value="True" />
  66. <Setter Property="HorizontalAlignment" Value="Left" />
  67. <Setter Property="Foreground" Value="Black" />
  68. <Setter Property="Height" Value="30" />
  69. <Setter Property="Margin" Value="0,0,0,0" />
  70. <Setter Property="Template">
  71. <Setter.Value>
  72. <ControlTemplate TargetType="ComboBox">
  73. <Grid Background="#F7FDF7">
  74. <Grid.ColumnDefinitions>
  75. <ColumnDefinition Width="0.8*" />
  76. <ColumnDefinition Width="0.2*" MaxWidth="20" />
  77. </Grid.ColumnDefinitions>
  78. <TextBox
  79. Grid.Column="0"
  80. VerticalContentAlignment="Center"
  81. IsReadOnly="True"
  82. Text="{TemplateBinding Text}" />
  83. <Border
  84. Grid.Column="0"
  85. BorderBrush="#FFDCDCDC"
  86. BorderThickness="1,1,1,1"
  87. CornerRadius="1,0,0,1" />
  88. <Border
  89. Grid.Column="1"
  90. BorderBrush="#FFDCDCDC"
  91. BorderThickness="0,1,1,1"
  92. CornerRadius="0,1,1,0">
  93. <ToggleButton
  94. ClickMode="Press"
  95. IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  96. Style="{StaticResource stlToggleButton}" />
  97. </Border>
  98. <Popup
  99. x:Name="Popup"
  100. AllowsTransparency="True"
  101. Focusable="False"
  102. IsOpen="{TemplateBinding IsDropDownOpen}"
  103. Placement="Bottom"
  104. PopupAnimation="Slide">
  105. <Border
  106. x:Name="DropDown"
  107. MinWidth="{TemplateBinding ActualWidth}"
  108. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  109. CornerRadius="1"
  110. SnapsToDevicePixels="True">
  111. <Border.Effect>
  112. <DropShadowEffect
  113. BlurRadius="2"
  114. Opacity="0.5"
  115. ShadowDepth="0"
  116. Color="Black" />
  117. </Border.Effect>
  118. <ScrollViewer
  119. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  120. Margin="4,6,4,6"
  121. CanContentScroll="True"
  122. HorizontalScrollBarVisibility="Auto"
  123. SnapsToDevicePixels="True"
  124. Style="{DynamicResource ScrollViewerStyle}"
  125. VerticalScrollBarVisibility="Auto">
  126. <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
  127. <StackPanel
  128. Background="White"
  129. IsItemsHost="True"
  130. KeyboardNavigation.DirectionalNavigation="Contained" />
  131. </ScrollViewer>
  132. </Border>
  133. </Popup>
  134. </Grid>
  135. </ControlTemplate>
  136. </Setter.Value>
  137. </Setter>
  138. </Style>
  139. </Window.Resources>
  140. <Grid>
  141. <Grid.RowDefinitions>
  142. <RowDefinition Height="46" />
  143. <RowDefinition Height="*" />
  144. </Grid.RowDefinitions>
  145. <Grid
  146. x:Name="GridTitle_Black"
  147. Grid.Row="0"
  148. Margin="0,0"
  149. Background="#FFF1F2F8"
  150. MouseLeftButtonDown="Window_MouseLeftButtonDown">
  151. <TextBlock
  152. Grid.RowSpan="2"
  153. Padding="10,13,0,0"
  154. FontSize="16"
  155. Foreground="#FF333333"
  156. Text="设备检测" />
  157. <Button
  158. x:Name="btnDown_Black"
  159. Grid.Row="0"
  160. Width="46"
  161. HorizontalAlignment="Right"
  162. VerticalAlignment="Top"
  163. Click="BtnDown_Click"
  164. Content="×"
  165. Cursor="Hand"
  166. FontSize="30"
  167. Foreground="#FF333333"
  168. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
  169. </Grid>
  170. <Grid Grid.Row="1">
  171. <Grid.ColumnDefinitions>
  172. <ColumnDefinition Width="100*" />
  173. <ColumnDefinition Width="300*" />
  174. </Grid.ColumnDefinitions>
  175. <Grid Grid.Column="0">
  176. <Border BorderBrush="#FFE9E9E9" BorderThickness="0,0,1,0">
  177. <StackPanel Margin="0,10" VerticalAlignment="Top">
  178. <Button
  179. x:Name="BtnCamera"
  180. Margin="0,10,0,10"
  181. HorizontalAlignment="Stretch"
  182. VerticalAlignment="Stretch"
  183. Click="BtnCamera_Click"
  184. Cursor="Hand"
  185. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  186. <StackPanel Orientation="Horizontal">
  187. <Image
  188. Height="18"
  189. Margin="6,0"
  190. HorizontalAlignment="Left"
  191. Source="/BlackImages/Device_Camera.png" />
  192. <TextBlock
  193. Width="100"
  194. Padding="0,0,0,0"
  195. HorizontalAlignment="Center"
  196. FontSize="18"
  197. Text="摄像头" />
  198. </StackPanel>
  199. </Button>
  200. <Button
  201. x:Name="BtnSpeaker"
  202. Margin="0,10,0,10"
  203. HorizontalAlignment="Stretch"
  204. VerticalAlignment="Stretch"
  205. Click="BtnSpeaker_Click"
  206. Cursor="Hand"
  207. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  208. <StackPanel Orientation="Horizontal">
  209. <Image
  210. Height="18"
  211. Margin="6,0"
  212. HorizontalAlignment="Left"
  213. Source="/BlackImages/Device_Voice.png" />
  214. <TextBlock
  215. Width="100"
  216. Padding="0,0,0,0"
  217. HorizontalAlignment="Center"
  218. FontSize="18"
  219. Text="扬声器" />
  220. </StackPanel>
  221. </Button>
  222. <Button
  223. x:Name="BtnMicrophone"
  224. Margin="0,10,0,10"
  225. HorizontalAlignment="Stretch"
  226. VerticalAlignment="Stretch"
  227. Click="BtnMicrophone_Click"
  228. Cursor="Hand"
  229. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  230. <StackPanel Orientation="Horizontal">
  231. <Image
  232. Height="18"
  233. Margin="6,0"
  234. HorizontalAlignment="Left"
  235. Source="/BlackImages/Device_Microphone.png" />
  236. <TextBlock
  237. Width="100"
  238. Padding="0,0,0,0"
  239. HorizontalAlignment="Center"
  240. FontSize="18"
  241. Text="麦克风" />
  242. </StackPanel>
  243. </Button>
  244. <Button
  245. x:Name="BtnDetectionPage"
  246. Margin="0,10,0,10"
  247. HorizontalAlignment="Stretch"
  248. VerticalAlignment="Stretch"
  249. Click="BtnDetectionPage_Click"
  250. Cursor="Hand"
  251. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  252. <StackPanel Orientation="Horizontal">
  253. <Image
  254. Height="18"
  255. Margin="6,0"
  256. HorizontalAlignment="Left"
  257. Source="/BlackImages/Device_JC.png" />
  258. <TextBlock
  259. Width="100"
  260. Padding="0,0,0,0"
  261. HorizontalAlignment="Center"
  262. FontSize="18"
  263. Text="设备检测" />
  264. </StackPanel>
  265. </Button>
  266. </StackPanel>
  267. </Border>
  268. </Grid>
  269. <Grid
  270. x:Name="GridDetection"
  271. Grid.Column="1"
  272. Margin="25,15"
  273. Visibility="Visible">
  274. <Grid.ColumnDefinitions>
  275. <ColumnDefinition Width="50*" />
  276. <ColumnDefinition Width="50*" />
  277. </Grid.ColumnDefinitions>
  278. <Grid.RowDefinitions>
  279. <RowDefinition Height="50*" />
  280. <RowDefinition Height="50*" />
  281. <RowDefinition Height="50*" />
  282. <RowDefinition Height="50*" />
  283. <RowDefinition Height="50*" />
  284. <RowDefinition Height="50*" />
  285. <RowDefinition Height="50*" />
  286. </Grid.RowDefinitions>
  287. <Grid Grid.Row="0" Grid.Column="0">
  288. <TextBlock
  289. HorizontalAlignment="Center"
  290. VerticalAlignment="Center"
  291. FontSize="18"
  292. Foreground="#FF999999"
  293. Text="设备名称" />
  294. </Grid>
  295. <Grid Grid.Row="0" Grid.Column="1">
  296. <TextBlock
  297. HorizontalAlignment="Center"
  298. VerticalAlignment="Center"
  299. FontSize="18"
  300. Foreground="#FF999999"
  301. Text="检测结果" />
  302. </Grid>
  303. <!-- 摄像头 -->
  304. <Grid Grid.Row="1" Grid.Column="0">
  305. <TextBlock
  306. HorizontalAlignment="Center"
  307. VerticalAlignment="Center"
  308. FontSize="17"
  309. Foreground="#FF000000"
  310. Text="摄像头" />
  311. </Grid>
  312. <Grid Grid.Row="1" Grid.Column="1">
  313. <TextBlock
  314. x:Name="TxbCamera"
  315. HorizontalAlignment="Center"
  316. VerticalAlignment="Center"
  317. FontSize="17"
  318. Foreground="#FF000000"
  319. Text="" />
  320. </Grid>
  321. <!-- 扬声器 -->
  322. <Grid Grid.Row="2" Grid.Column="0">
  323. <TextBlock
  324. HorizontalAlignment="Center"
  325. VerticalAlignment="Center"
  326. FontSize="17"
  327. Foreground="#FF000000"
  328. Text="扬声器" />
  329. </Grid>
  330. <Grid Grid.Row="2" Grid.Column="1">
  331. <TextBlock
  332. x:Name="TxbSpeaker"
  333. HorizontalAlignment="Center"
  334. VerticalAlignment="Center"
  335. FontSize="17"
  336. Foreground="#FF000000"
  337. Text="" />
  338. </Grid>
  339. <!-- 麦克风 -->
  340. <Grid Grid.Row="3" Grid.Column="0">
  341. <TextBlock
  342. HorizontalAlignment="Center"
  343. VerticalAlignment="Center"
  344. FontSize="17"
  345. Foreground="#FF000000"
  346. Text="麦克风" />
  347. </Grid>
  348. <Grid Grid.Row="3" Grid.Column="1">
  349. <TextBlock
  350. x:Name="TxbMicrophone"
  351. HorizontalAlignment="Center"
  352. VerticalAlignment="Center"
  353. FontSize="17"
  354. Foreground="#FF000000"
  355. Text="" />
  356. </Grid>
  357. <Grid Grid.Row="6" Grid.Column="1">
  358. <Button
  359. x:Name="BtnDetection"
  360. Grid.Row="2"
  361. Width="116"
  362. Height="46"
  363. Margin="0"
  364. HorizontalAlignment="Right"
  365. VerticalAlignment="Stretch"
  366. Click="BtnDetection_Click"
  367. Content="开始检测"
  368. Cursor="Hand"
  369. FontSize="17"
  370. Foreground="White"
  371. IsDefault="True"
  372. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  373. <Button.Template>
  374. <ControlTemplate TargetType="{x:Type Button}">
  375. <Border
  376. BorderBrush="{TemplateBinding BorderBrush}"
  377. BorderThickness="1"
  378. CornerRadius="23">
  379. <Border.Background>
  380. <Brush>#2E8CF0</Brush>
  381. </Border.Background>
  382. <ContentPresenter
  383. HorizontalAlignment="Center"
  384. VerticalAlignment="Center"
  385. Content="{TemplateBinding Content}" />
  386. </Border>
  387. </ControlTemplate>
  388. </Button.Template>
  389. </Button>
  390. </Grid>
  391. </Grid>
  392. <Grid
  393. x:Name="GridCamera"
  394. Grid.Column="1"
  395. Visibility="Collapsed">
  396. <Grid.RowDefinitions>
  397. <RowDefinition Height="66*" />
  398. <RowDefinition Height="250*" />
  399. <RowDefinition Height="70*" />
  400. </Grid.RowDefinitions>
  401. <StackPanel
  402. Grid.Row="0"
  403. Margin="30,20,0,0"
  404. HorizontalAlignment="Left"
  405. VerticalAlignment="Top"
  406. Orientation="Horizontal">
  407. <TextBlock
  408. Margin="0,5,0,0"
  409. HorizontalAlignment="Left"
  410. VerticalAlignment="Top"
  411. FontSize="17"
  412. Foreground="#FF000000"
  413. Text="摄像头:" />
  414. <ComboBox
  415. x:Name="CmbCameraList"
  416. Width="210"
  417. Padding="30,0,10,0"
  418. HorizontalAlignment="Left"
  419. VerticalAlignment="Top"
  420. HorizontalContentAlignment="Center"
  421. VerticalContentAlignment="Center"
  422. Background="White"
  423. BorderThickness="0"
  424. Cursor="Hand"
  425. DisplayMemberPath="Value"
  426. FontSize="14"
  427. SelectedValuePath="Key"
  428. Style="{StaticResource stlComboBox}"
  429. Text="请选择" />
  430. </StackPanel>
  431. <Grid
  432. Grid.Row="1"
  433. Width="300"
  434. Height="250"
  435. Margin="30,0,0,0"
  436. HorizontalAlignment="Left"
  437. VerticalAlignment="Top"
  438. Background="#FFF1F2F8">
  439. <Image
  440. x:Name="imgPlayer"
  441. RenderTransformOrigin="0.5,0.5"
  442. Visibility="Visible">
  443. <Image.RenderTransform>
  444. <ScaleTransform ScaleX="-1" />
  445. </Image.RenderTransform>
  446. </Image>
  447. </Grid>
  448. <StackPanel
  449. Grid.Row="2"
  450. Margin="30,15,0,0"
  451. HorizontalAlignment="Left"
  452. VerticalAlignment="Top"
  453. Orientation="Horizontal">
  454. <Button
  455. x:Name="BtnCameraStat"
  456. Width="70"
  457. Height="30"
  458. Margin="0,0,0,0"
  459. HorizontalAlignment="Stretch"
  460. VerticalAlignment="Stretch"
  461. Click="BtnCameraStat_Click"
  462. Content="播放"
  463. Cursor="Hand"
  464. FontSize="15"
  465. Foreground="White"
  466. IsDefault="True"
  467. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  468. <Button.Template>
  469. <ControlTemplate TargetType="{x:Type Button}">
  470. <Border
  471. BorderBrush="{TemplateBinding BorderBrush}"
  472. BorderThickness="1"
  473. CornerRadius="7">
  474. <Border.Background>
  475. <Brush>#2E8CF0</Brush>
  476. </Border.Background>
  477. <ContentPresenter
  478. HorizontalAlignment="Center"
  479. VerticalAlignment="Center"
  480. Content="{TemplateBinding Content}" />
  481. </Border>
  482. </ControlTemplate>
  483. </Button.Template>
  484. </Button>
  485. <Button
  486. x:Name="BtnCameraStop"
  487. Width="70"
  488. Height="30"
  489. Margin="10,0,0,0"
  490. HorizontalAlignment="Stretch"
  491. VerticalAlignment="Stretch"
  492. Click="BtnCameraStop_Click"
  493. Content="停止"
  494. Cursor="Hand"
  495. FontSize="15"
  496. Foreground="White"
  497. IsDefault="True"
  498. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  499. <Button.Template>
  500. <ControlTemplate TargetType="{x:Type Button}">
  501. <Border
  502. BorderBrush="{TemplateBinding BorderBrush}"
  503. BorderThickness="1"
  504. CornerRadius="7">
  505. <Border.Background>
  506. <Brush>#CCCCCC</Brush>
  507. </Border.Background>
  508. <ContentPresenter
  509. HorizontalAlignment="Center"
  510. VerticalAlignment="Center"
  511. Content="{TemplateBinding Content}" />
  512. </Border>
  513. </ControlTemplate>
  514. </Button.Template>
  515. </Button>
  516. <Button
  517. x:Name="BtnCameraSave"
  518. Width="70"
  519. Height="30"
  520. Margin="80,0,0,0"
  521. HorizontalAlignment="Stretch"
  522. VerticalAlignment="Stretch"
  523. Click="BtnCameraSave_Click"
  524. Content="设置"
  525. Cursor="Hand"
  526. FontSize="15"
  527. Foreground="White"
  528. IsDefault="True"
  529. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  530. <Button.Template>
  531. <ControlTemplate TargetType="{x:Type Button}">
  532. <Border
  533. BorderBrush="{TemplateBinding BorderBrush}"
  534. BorderThickness="1"
  535. CornerRadius="7">
  536. <Border.Background>
  537. <Brush>#2E8CF0</Brush>
  538. </Border.Background>
  539. <ContentPresenter
  540. HorizontalAlignment="Center"
  541. VerticalAlignment="Center"
  542. Content="{TemplateBinding Content}" />
  543. </Border>
  544. </ControlTemplate>
  545. </Button.Template>
  546. </Button>
  547. </StackPanel>
  548. </Grid>
  549. <Grid
  550. x:Name="GridSpeaker"
  551. Grid.Column="1"
  552. Visibility="Collapsed">
  553. <Grid.RowDefinitions>
  554. <RowDefinition Height="56*" />
  555. <RowDefinition Height="180*" />
  556. <RowDefinition Height="150*" />
  557. </Grid.RowDefinitions>
  558. <Grid Grid.Row="0">
  559. <StackPanel
  560. Margin="30,20,0,0"
  561. HorizontalAlignment="Left"
  562. VerticalAlignment="Top"
  563. Orientation="Horizontal">
  564. <Button
  565. x:Name="BtnSpeakerDetection"
  566. Grid.Row="2"
  567. Width="100"
  568. Height="30"
  569. Margin="0"
  570. HorizontalAlignment="Stretch"
  571. VerticalAlignment="Stretch"
  572. Click="BtnSpeakerDetection_Click"
  573. Content="播放音频"
  574. Cursor="Hand"
  575. FontSize="15"
  576. Foreground="White"
  577. IsDefault="True"
  578. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  579. <Button.Template>
  580. <ControlTemplate TargetType="{x:Type Button}">
  581. <Border
  582. BorderBrush="{TemplateBinding BorderBrush}"
  583. BorderThickness="1"
  584. CornerRadius="7">
  585. <Border.Background>
  586. <Brush>#2E8CF0</Brush>
  587. </Border.Background>
  588. <ContentPresenter
  589. HorizontalAlignment="Center"
  590. VerticalAlignment="Center"
  591. Content="{TemplateBinding Content}" />
  592. </Border>
  593. </ControlTemplate>
  594. </Button.Template>
  595. </Button>
  596. <MediaElement
  597. x:Name="MediaAudio"
  598. Width="0"
  599. LoadedBehavior="Manual"
  600. MediaEnded="MediaAudio_MediaEnded"
  601. MediaOpened="MediaAudio_MediaOpened"
  602. Stretch="Fill"
  603. Visibility="Hidden"
  604. Volume="1" />
  605. <!--<Slider x:Name="timelineSlider" Minimum="0" VerticalAlignment="Center" BorderThickness="0,5,0,0" Width="150" Height="30" />-->
  606. </StackPanel>
  607. </Grid>
  608. <Grid Grid.Row="1">
  609. <!--<MediaElement Source="/SkinImages/Other/Dev_AcousticWave2.gif" OpacityMask="#FF000000" HorizontalAlignment="Left" Margin="10,0,0,0" LoadedBehavior="{Binding ElementName=MediaAudio,Path=LoadedBehavior}"/>-->
  610. <Grid Margin="30,0,127,0" Background="#FFF1F2F8">
  611. <Image
  612. x:Name="ImgAcousticWave"
  613. HorizontalAlignment="Left"
  614. VerticalAlignment="Top"
  615. gif:ImageBehavior.AnimatedSource="/SkinImages/Other/Dev_AcousticWave2.gif"
  616. gif:ImageBehavior.AutoStart="True"
  617. gif:ImageBehavior.RepeatBehavior="Forever"
  618. Visibility="Hidden" />
  619. </Grid>
  620. </Grid>
  621. <Grid Grid.Row="2">
  622. <StackPanel
  623. Margin="30,0,0,0"
  624. HorizontalAlignment="Left"
  625. VerticalAlignment="Top"
  626. Orientation="Horizontal">
  627. <TextBlock
  628. Margin="0,5,0,0"
  629. HorizontalAlignment="Left"
  630. VerticalAlignment="Top"
  631. FontSize="17"
  632. Foreground="#FF000000"
  633. Text="声音采集:" />
  634. <TextBlock
  635. x:Name="TbxSpeakerDetection"
  636. Margin="0,5,0,0"
  637. HorizontalAlignment="Left"
  638. VerticalAlignment="Top"
  639. FontSize="17"
  640. Foreground="#FF000000"
  641. Text="待检测" />
  642. </StackPanel>
  643. </Grid>
  644. </Grid>
  645. <Grid
  646. x:Name="GridMicrophone"
  647. Grid.Column="1"
  648. Visibility="Collapsed">
  649. <Grid.RowDefinitions>
  650. <RowDefinition Height="50*" />
  651. <RowDefinition Height="45*" />
  652. <RowDefinition Height="196*" />
  653. <RowDefinition Height="95*" />
  654. </Grid.RowDefinitions>
  655. <StackPanel
  656. Grid.Row="0"
  657. Margin="30,0,0,0"
  658. HorizontalAlignment="Left"
  659. VerticalAlignment="Center"
  660. Orientation="Horizontal">
  661. <TextBlock
  662. Margin="0,5,0,0"
  663. HorizontalAlignment="Left"
  664. VerticalAlignment="Top"
  665. FontSize="17"
  666. Foreground="#FF000000"
  667. Text="麦克风:" />
  668. <ComboBox
  669. x:Name="CmbMicrophoneList"
  670. Width="210"
  671. Padding="30,0,10,0"
  672. HorizontalAlignment="Left"
  673. VerticalAlignment="Top"
  674. HorizontalContentAlignment="Center"
  675. VerticalContentAlignment="Center"
  676. Background="White"
  677. BorderThickness="0"
  678. Cursor="Hand"
  679. DisplayMemberPath="Value"
  680. FontSize="14"
  681. SelectedValuePath="Key"
  682. Style="{StaticResource stlComboBox}"
  683. Text="请选择" />
  684. <Button
  685. x:Name="BtnMicrophoneSave"
  686. Grid.Row="2"
  687. Width="70"
  688. Height="30"
  689. Margin="10,0,0,0"
  690. HorizontalAlignment="Stretch"
  691. VerticalAlignment="Stretch"
  692. Click="BtnMicrophoneSave_Click"
  693. Content="设置"
  694. Cursor="Hand"
  695. FontSize="15"
  696. Foreground="White"
  697. IsDefault="True"
  698. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  699. <Button.Template>
  700. <ControlTemplate TargetType="{x:Type Button}">
  701. <Border
  702. BorderBrush="{TemplateBinding BorderBrush}"
  703. BorderThickness="1"
  704. CornerRadius="7">
  705. <Border.Background>
  706. <Brush>#2E8CF0</Brush>
  707. </Border.Background>
  708. <ContentPresenter
  709. HorizontalAlignment="Center"
  710. VerticalAlignment="Center"
  711. Content="{TemplateBinding Content}" />
  712. </Border>
  713. </ControlTemplate>
  714. </Button.Template>
  715. </Button>
  716. </StackPanel>
  717. <StackPanel
  718. Grid.Row="1"
  719. Margin="30,0,0,0"
  720. HorizontalAlignment="Left"
  721. VerticalAlignment="Center"
  722. Orientation="Horizontal">
  723. <Button
  724. x:Name="BtnMicrophoneDetection"
  725. Width="100"
  726. Height="30"
  727. Margin="0"
  728. HorizontalAlignment="Stretch"
  729. VerticalAlignment="Stretch"
  730. Click="BtnMicrophoneDetection_Click"
  731. Content="开始录音"
  732. Cursor="Hand"
  733. FontSize="15"
  734. Foreground="White"
  735. IsDefault="True"
  736. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  737. <Button.Template>
  738. <ControlTemplate TargetType="{x:Type Button}">
  739. <Border
  740. BorderBrush="{TemplateBinding BorderBrush}"
  741. BorderThickness="1"
  742. CornerRadius="7">
  743. <Border.Background>
  744. <Brush>#2E8CF0</Brush>
  745. </Border.Background>
  746. <ContentPresenter
  747. HorizontalAlignment="Center"
  748. VerticalAlignment="Center"
  749. Content="{TemplateBinding Content}" />
  750. </Border>
  751. </ControlTemplate>
  752. </Button.Template>
  753. </Button>
  754. <Button
  755. x:Name="BtnMicrophoneDetectionPlay"
  756. Width="100"
  757. Height="30"
  758. Margin="10,0,0,0"
  759. HorizontalAlignment="Stretch"
  760. VerticalAlignment="Stretch"
  761. Click="BtnMicrophoneDetectionPlay_Click"
  762. Content="播放"
  763. Cursor="Hand"
  764. FontSize="15"
  765. Foreground="White"
  766. IsDefault="True"
  767. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
  768. <Button.Template>
  769. <ControlTemplate TargetType="{x:Type Button}">
  770. <Border
  771. BorderBrush="{TemplateBinding BorderBrush}"
  772. BorderThickness="1"
  773. CornerRadius="7">
  774. <Border.Background>
  775. <Brush>#2E8CF0</Brush>
  776. </Border.Background>
  777. <ContentPresenter
  778. HorizontalAlignment="Center"
  779. VerticalAlignment="Center"
  780. Content="{TemplateBinding Content}" />
  781. </Border>
  782. </ControlTemplate>
  783. </Button.Template>
  784. </Button>
  785. <MediaElement
  786. x:Name="MediaAudioMicPlay"
  787. Width="0"
  788. LoadedBehavior="Manual"
  789. MediaEnded="MediaAudioMicPlay_MediaEnded"
  790. Stretch="Fill"
  791. Visibility="Hidden"
  792. Volume="1" />
  793. </StackPanel>
  794. <Grid Grid.Row="3">
  795. <StackPanel
  796. Margin="30,0,0,0"
  797. HorizontalAlignment="Left"
  798. VerticalAlignment="Top"
  799. Orientation="Horizontal">
  800. <TextBlock
  801. Margin="0,5,0,0"
  802. HorizontalAlignment="Left"
  803. VerticalAlignment="Top"
  804. FontSize="17"
  805. Foreground="#FF000000"
  806. Text="麦克风采集:" />
  807. <TextBlock
  808. x:Name="TbxMicrophoneDetection"
  809. Margin="0,5,0,0"
  810. HorizontalAlignment="Left"
  811. VerticalAlignment="Top"
  812. FontSize="17"
  813. Foreground="#FF000000"
  814. Text="待检测" />
  815. </StackPanel>
  816. <CheckBox
  817. x:Name="CbxRecordingMicrophone"
  818. Margin="30,40,0,0"
  819. Padding="5,0,0,0"
  820. HorizontalAlignment="Left"
  821. VerticalAlignment="Top"
  822. VerticalContentAlignment="Center"
  823. Click="CbxRecordingMicrophone_Click"
  824. Content="录制麦克风"
  825. FontSize="16"
  826. IsChecked="True" />
  827. </Grid>
  828. <!--<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0">
  829. </StackPanel>-->
  830. <Grid Grid.Row="2">
  831. <Grid
  832. x:Name="GridMicImg"
  833. Width="320"
  834. Height="180"
  835. Margin="30,0,0,0"
  836. HorizontalAlignment="Left"
  837. Background="#FFF1F2F8"
  838. Visibility="Visible">
  839. <Image
  840. x:Name="ImgMicAcousticWave"
  841. HorizontalAlignment="Left"
  842. VerticalAlignment="Top"
  843. gif:ImageBehavior.AnimatedSource="/SkinImages/Other/Dev_AcousticWave2.gif"
  844. gif:ImageBehavior.AutoStart="True"
  845. gif:ImageBehavior.RepeatBehavior="Forever"
  846. Visibility="Hidden" />
  847. </Grid>
  848. </Grid>
  849. </Grid>
  850. </Grid>
  851. </Grid>
  852. </Window>