星火微课系统客户端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

DeviceWindow.xaml 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <Window x:Class="XHWK.WKTool.DeviceWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:gif="http://wpfanimatedgif.codeplex.com"
  7. xmlns:local="clr-namespace:XHWK.WKTool"
  8. mc:Ignorable="d"
  9. Title="设备检测" AllowsTransparency="True"
  10. ShowInTaskbar="False"
  11. WindowStartupLocation="CenterOwner"
  12. WindowStyle="None" BorderThickness="7" Width="650" Height="450">
  13. <Window.Effect>
  14. <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
  15. </Window.Effect>
  16. <Window.Resources>
  17. <!--摄像头样式-->
  18. <Style TargetType="ToggleButton" x:Key="stlToggleButton">
  19. <Setter Property="Foreground" Value="White"></Setter>
  20. <Setter Property="Template">
  21. <Setter.Value>
  22. <ControlTemplate>
  23. <Border x:Name="Back" Background="#FFFFFFFF" BorderThickness="0" BorderBrush="Transparent">
  24. <Path Name="PathFill" Fill="Black" Width="8" Height="6" StrokeThickness="0" Data="M5,0 L10,10 L0,10 z" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
  25. <Path.RenderTransform>
  26. <TransformGroup>
  27. <ScaleTransform/>
  28. <SkewTransform/>
  29. <RotateTransform Angle="180"/>
  30. <TranslateTransform/>
  31. </TransformGroup>
  32. </Path.RenderTransform>
  33. </Path>
  34. </Border>
  35. <ControlTemplate.Triggers>
  36. <Trigger Property="IsMouseOver" Value="True">
  37. <Setter TargetName="PathFill" Property="Fill" Value="White"></Setter>
  38. <Setter TargetName="Back" Property="Background" Value="#FFDCDCDC"></Setter>
  39. <Setter TargetName="Back" Property="BorderBrush" Value="#FFDCDCDC"></Setter>
  40. </Trigger>
  41. </ControlTemplate.Triggers>
  42. </ControlTemplate>
  43. </Setter.Value>
  44. </Setter>
  45. </Style>
  46. <Style TargetType="ComboBox" x:Key="stlComboBox">
  47. <Setter Property="SnapsToDevicePixels" Value="True"/>
  48. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
  49. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
  50. <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
  51. <Setter Property="HorizontalAlignment" Value="Left"></Setter>
  52. <Setter Property="Foreground" Value="Black"></Setter>
  53. <Setter Property="Height" Value="30"></Setter>
  54. <Setter Property="Margin" Value="0,0,0,0"></Setter>
  55. <Setter Property="Template">
  56. <Setter.Value>
  57. <ControlTemplate TargetType="ComboBox">
  58. <Grid Background="#F7FDF7">
  59. <Grid.ColumnDefinitions>
  60. <ColumnDefinition Width="0.8*"/>
  61. <ColumnDefinition Width="0.2*" MaxWidth="20"/>
  62. </Grid.ColumnDefinitions>
  63. <TextBox Grid.Column="0" IsReadOnly="True" VerticalContentAlignment="Center" Text="{TemplateBinding Text}"></TextBox>
  64. <Border Grid.Column="0" BorderThickness="1,1,1,1" BorderBrush="#FFDCDCDC" CornerRadius="1,0,0,1">
  65. </Border>
  66. <Border Grid.Column="1" BorderThickness="0,1,1,1" BorderBrush="#FFDCDCDC" CornerRadius="0,1,1,0">
  67. <ToggleButton Style="{StaticResource stlToggleButton}" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"></ToggleButton>
  68. </Border>
  69. <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
  70. <Border CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
  71. <Border.Effect>
  72. <DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
  73. </Border.Effect>
  74. <ScrollViewer Margin="4,6,4,6" Style="{DynamicResource ScrollViewerStyle}" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
  75. <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
  76. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
  77. </ScrollViewer>
  78. </Border>
  79. </Popup>
  80. </Grid>
  81. </ControlTemplate>
  82. </Setter.Value>
  83. </Setter>
  84. </Style>
  85. </Window.Resources>
  86. <Grid>
  87. <Grid.RowDefinitions>
  88. <RowDefinition Height="50"/>
  89. <RowDefinition Height="*"/>
  90. </Grid.RowDefinitions>
  91. <Grid x:Name="GridTitle_Black" Margin="0,0" Grid.Row="0" Background="#FFF1F2F8" MouseLeftButtonDown="Window_MouseLeftButtonDown">
  92. <TextBlock Text="设备检测" Foreground="#FF333333" FontSize="16" Padding="10,13,0,0" Grid.RowSpan="2"/>
  93. <Button Cursor="Hand" Grid.Row="0" x:Name="btnDown_Black" Content="×" VerticalAlignment="Top" Foreground="#FF333333" FontSize="30" Padding="10,2,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
  94. </Grid>
  95. <Grid Grid.Row="1">
  96. <Grid.ColumnDefinitions>
  97. <ColumnDefinition Width="100*"/>
  98. <ColumnDefinition Width="300*"/>
  99. </Grid.ColumnDefinitions>
  100. <Grid Grid.Column="0">
  101. <Border BorderBrush="#FFE9E9E9" BorderThickness="1" CornerRadius="7">
  102. <StackPanel Margin="0,10" VerticalAlignment="Center">
  103. <Button x:Name="BtnCamera" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,10,0,10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnCamera_Click">
  104. <StackPanel Orientation="Horizontal">
  105. <Image Source="/BlackImages/Device_Camera.png" Margin="6,0" HorizontalAlignment="Left"/>
  106. <TextBlock Text="摄像头" FontSize="20" Padding="0,2,0,0" HorizontalAlignment="Center"/>
  107. </StackPanel>
  108. </Button>
  109. <Button x:Name="BtnSpeaker" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,10,0,10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnSpeaker_Click">
  110. <StackPanel Orientation="Horizontal">
  111. <Image Source="/BlackImages/Device_Voice.png" Margin="6,0" HorizontalAlignment="Left"/>
  112. <TextBlock Text="扬声器" FontSize="20" Padding="0,2,0,0" HorizontalAlignment="Center"/>
  113. </StackPanel>
  114. </Button>
  115. <Button x:Name="BtnMicrophone" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,10,0,10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnMicrophone_Click">
  116. <StackPanel Orientation="Horizontal">
  117. <Image Source="/BlackImages/Device_Microphone.png" Margin="6,0" HorizontalAlignment="Left"/>
  118. <TextBlock Text="麦克风" FontSize="20" Padding="0,2,0,0" HorizontalAlignment="Center"/>
  119. </StackPanel>
  120. </Button>
  121. <Button x:Name="BtnDetectionPage" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,10,0,10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnDetectionPage_Click">
  122. <StackPanel Orientation="Horizontal">
  123. <Image Source="/BlackImages/Device_JC.png" Margin="6,0" HorizontalAlignment="Left"/>
  124. <TextBlock Text="设备检测" FontSize="20" Padding="0,2,0,0" HorizontalAlignment="Center"/>
  125. </StackPanel>
  126. </Button>
  127. </StackPanel>
  128. </Border>
  129. </Grid>
  130. <Grid x:Name="GridDetection" Grid.Column="1" Margin="25,15" Visibility="Collapsed">
  131. <Grid.ColumnDefinitions>
  132. <ColumnDefinition Width="50*"/>
  133. <ColumnDefinition Width="50*"/>
  134. </Grid.ColumnDefinitions>
  135. <Grid.RowDefinitions>
  136. <RowDefinition Height="50*"/>
  137. <RowDefinition Height="50*"/>
  138. <RowDefinition Height="50*"/>
  139. <RowDefinition Height="50*"/>
  140. <RowDefinition Height="50*"/>
  141. <RowDefinition Height="50*"/>
  142. <RowDefinition Height="50*"/>
  143. </Grid.RowDefinitions>
  144. <Grid Grid.Row="0" Grid.Column="0">
  145. <TextBlock Text="设备名称" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF999999" ></TextBlock>
  146. </Grid>
  147. <Grid Grid.Row="0" Grid.Column="1">
  148. <TextBlock Text="检测结果" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF999999" ></TextBlock>
  149. </Grid>
  150. <!--摄像头-->
  151. <Grid Grid.Row="1" Grid.Column="0">
  152. <TextBlock Text="摄像头" FontSize="17" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF000000" ></TextBlock>
  153. </Grid>
  154. <Grid Grid.Row="1" Grid.Column="1">
  155. <TextBlock x:Name="TxbCamera" Text="" FontSize="17" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF000000" ></TextBlock>
  156. </Grid>
  157. <!--扬声器-->
  158. <Grid Grid.Row="2" Grid.Column="0">
  159. <TextBlock Text="扬声器" FontSize="17" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF000000" ></TextBlock>
  160. </Grid>
  161. <Grid Grid.Row="2" Grid.Column="1">
  162. <TextBlock x:Name="TxbSpeaker" Text="" FontSize="17" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF000000" ></TextBlock>
  163. </Grid>
  164. <!--麦克风-->
  165. <Grid Grid.Row="3" Grid.Column="0">
  166. <TextBlock Text="麦克风" FontSize="17" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF000000" ></TextBlock>
  167. </Grid>
  168. <Grid Grid.Row="3" Grid.Column="1">
  169. <TextBlock x:Name="TxbMicrophone" Text="" FontSize="17" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF000000" ></TextBlock>
  170. </Grid>
  171. <Grid Grid.Row="6" Grid.Column="1">
  172. <Button x:Name="BtnDetection" Grid.Row="2" Width="116" Height="46" Content="开始检测" Foreground="White" FontSize="17" IsDefault="True" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnDetection_Click">
  173. <Button.Template>
  174. <ControlTemplate TargetType="{x:Type Button}">
  175. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="25">
  176. <Border.Background>
  177. <Brush>#2E8CF0</Brush>
  178. </Border.Background>
  179. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
  180. </Border>
  181. </ControlTemplate>
  182. </Button.Template>
  183. </Button>
  184. </Grid>
  185. </Grid>
  186. <Grid x:Name="GridCamera" Grid.Column="1" Visibility="Visible">
  187. <Grid.RowDefinitions>
  188. <RowDefinition Height="66*"/>
  189. <RowDefinition Height="250*"/>
  190. <RowDefinition Height="70*"/>
  191. </Grid.RowDefinitions>
  192. <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30,20,0,0">
  193. <TextBlock Text="摄像头:" FontSize="17" Foreground="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" ></TextBlock>
  194. <ComboBox Text="请选择" Cursor="Hand" Width="210" x:Name="CmbCameraList" Padding="30,0,10,0" Style="{StaticResource stlComboBox}" BorderThickness="0" DisplayMemberPath="Value" FontSize="14" SelectedValuePath="Key" Background="White" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Top" />
  195. </StackPanel>
  196. <Grid Grid.Row="1" Width="300" Height="250" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30,0,0,0" Background="#FFF1F2F8">
  197. <Image x:Name="imgPlayer" Visibility="Visible" RenderTransformOrigin="0.5,0.5" >
  198. <Image.RenderTransform>
  199. <ScaleTransform ScaleX="-1"/>
  200. </Image.RenderTransform>
  201. </Image>
  202. </Grid>
  203. <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30,15,0,0">
  204. <Button x:Name="BtnCameraStat" Width="70" Height="30" Content="播放" Foreground="White" FontSize="15" IsDefault="True" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnCameraStat_Click">
  205. <Button.Template>
  206. <ControlTemplate TargetType="{x:Type Button}">
  207. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7">
  208. <Border.Background>
  209. <Brush>#2E8CF0</Brush>
  210. </Border.Background>
  211. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
  212. </Border>
  213. </ControlTemplate>
  214. </Button.Template>
  215. </Button>
  216. <Button x:Name="BtnCameraStop" Width="70" Height="30" Content="停止" Foreground="White" FontSize="15" IsDefault="True" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="10,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnCameraStop_Click">
  217. <Button.Template>
  218. <ControlTemplate TargetType="{x:Type Button}">
  219. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7">
  220. <Border.Background>
  221. <Brush>#CCCCCC</Brush>
  222. </Border.Background>
  223. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
  224. </Border>
  225. </ControlTemplate>
  226. </Button.Template>
  227. </Button>
  228. <Button x:Name="BtnCameraSave" Width="70" Height="30" Content="设置" Foreground="White" FontSize="15" IsDefault="True" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="80,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnCameraSave_Click">
  229. <Button.Template>
  230. <ControlTemplate TargetType="{x:Type Button}">
  231. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7">
  232. <Border.Background>
  233. <Brush>#2E8CF0</Brush>
  234. </Border.Background>
  235. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
  236. </Border>
  237. </ControlTemplate>
  238. </Button.Template>
  239. </Button>
  240. </StackPanel>
  241. </Grid>
  242. <Grid x:Name="GridSpeaker" Grid.Column="1" Visibility="Collapsed">
  243. <Grid.RowDefinitions>
  244. <RowDefinition Height="56*"/>
  245. <RowDefinition Height="180*"/>
  246. <RowDefinition Height="150*"/>
  247. </Grid.RowDefinitions>
  248. <Grid Grid.Row="0">
  249. <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30,20,0,0">
  250. <Button x:Name="BtnSpeakerDetection" Grid.Row="2" Width="100" Height="30" Content="播放音频" Foreground="White" FontSize="15" IsDefault="True" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnSpeakerDetection_Click" >
  251. <Button.Template>
  252. <ControlTemplate TargetType="{x:Type Button}">
  253. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7">
  254. <Border.Background>
  255. <Brush>#2E8CF0</Brush>
  256. </Border.Background>
  257. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
  258. </Border>
  259. </ControlTemplate>
  260. </Button.Template>
  261. </Button>
  262. <MediaElement x:Name="MediaAudio" Stretch="Fill" LoadedBehavior="Manual" Width="0" Volume="1" MediaOpened="MediaAudio_MediaOpened" MediaEnded="MediaAudio_MediaEnded" Visibility="Hidden"/>
  263. <!--<Slider x:Name="timelineSlider" Minimum="0" VerticalAlignment="Center" BorderThickness="0,5,0,0" Width="150" Height="30" />-->
  264. </StackPanel>
  265. </Grid>
  266. <Grid Grid.Row="1">
  267. <!--<MediaElement Source="/SkinImages/Other/Dev_AcousticWave2.gif" OpacityMask="#FF000000" HorizontalAlignment="Left" Margin="10,0,0,0" LoadedBehavior="{Binding ElementName=MediaAudio,Path=LoadedBehavior}"/>-->
  268. <Grid Margin="30,0,127,0" Background="#FFF1F2F8">
  269. <Image x:Name="ImgAcousticWave" gif:ImageBehavior.AnimatedSource="/SkinImages/Other/Dev_AcousticWave2.gif" gif:ImageBehavior.AutoStart="True" gif:ImageBehavior.RepeatBehavior="Forever" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Hidden"/>
  270. </Grid>
  271. </Grid>
  272. <Grid Grid.Row="2">
  273. <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30,0,0,0">
  274. <TextBlock Text="声音采集:" FontSize="17" Foreground="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" ></TextBlock>
  275. <TextBlock x:Name="TbxSpeakerDetection" Text="待检测" FontSize="17" Foreground="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" ></TextBlock>
  276. </StackPanel>
  277. </Grid>
  278. </Grid>
  279. <Grid x:Name="GridMicrophone" Grid.Column="1" Visibility="Collapsed">
  280. <Grid.RowDefinitions>
  281. <RowDefinition Height="50*"/>
  282. <RowDefinition Height="45*"/>
  283. <RowDefinition Height="196*"/>
  284. <RowDefinition Height="95*"/>
  285. </Grid.RowDefinitions>
  286. <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0">
  287. <TextBlock Text="麦克风:" FontSize="17" Foreground="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" ></TextBlock>
  288. <ComboBox Text="请选择" Cursor="Hand" Width="210" x:Name="CmbMicrophoneList" Padding="30,0,10,0" Style="{StaticResource stlComboBox}" BorderThickness="0" DisplayMemberPath="Value" FontSize="14" SelectedValuePath="Key" Background="White" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Top" />
  289. <Button x:Name="BtnMicrophoneSave" Grid.Row="2" Width="70" Height="30" Content="设置" Foreground="White" FontSize="15" IsDefault="True" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="10,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnMicrophoneSave_Click">
  290. <Button.Template>
  291. <ControlTemplate TargetType="{x:Type Button}">
  292. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7">
  293. <Border.Background>
  294. <Brush>#2E8CF0</Brush>
  295. </Border.Background>
  296. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
  297. </Border>
  298. </ControlTemplate>
  299. </Button.Template>
  300. </Button>
  301. </StackPanel>
  302. <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0">
  303. <Button x:Name="BtnMicrophoneDetection" Width="100" Height="30" Content="开始录音" Foreground="White" FontSize="15" IsDefault="True" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnMicrophoneDetection_Click" >
  304. <Button.Template>
  305. <ControlTemplate TargetType="{x:Type Button}">
  306. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7">
  307. <Border.Background>
  308. <Brush>#2E8CF0</Brush>
  309. </Border.Background>
  310. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
  311. </Border>
  312. </ControlTemplate>
  313. </Button.Template>
  314. </Button>
  315. <Button x:Name="BtnMicrophoneDetectionPlay" Width="100" Height="30" Content="播放" Foreground="White" FontSize="15" IsDefault="True" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnMicrophoneDetectionPlay_Click" Margin="10,0,0,0" >
  316. <Button.Template>
  317. <ControlTemplate TargetType="{x:Type Button}">
  318. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7">
  319. <Border.Background>
  320. <Brush>#2E8CF0</Brush>
  321. </Border.Background>
  322. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
  323. </Border>
  324. </ControlTemplate>
  325. </Button.Template>
  326. </Button>
  327. <MediaElement x:Name="MediaAudioMicPlay" Stretch="Fill" LoadedBehavior="Manual" Width="0" Volume="1" MediaEnded="MediaAudioMicPlay_MediaEnded" Visibility="Hidden"/>
  328. </StackPanel>
  329. <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30,0,0,0">
  330. <TextBlock Text="麦克风采集:" FontSize="17" Foreground="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" ></TextBlock>
  331. <TextBlock x:Name="TbxMicrophoneDetection" Text="待检测" FontSize="17" Foreground="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" ></TextBlock>
  332. </StackPanel>
  333. <!--<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0">
  334. </StackPanel>-->
  335. <Grid Grid.Row="2">
  336. <Grid x:Name="GridMicImg" Margin="30,0,0,0" Background="#FFF1F2F8" Width="320" Height="180" HorizontalAlignment="Left" Visibility="Visible">
  337. <Image x:Name="ImgMicAcousticWave" gif:ImageBehavior.AnimatedSource="/SkinImages/Other/Dev_AcousticWave2.gif" gif:ImageBehavior.AutoStart="True" gif:ImageBehavior.RepeatBehavior="Forever" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Hidden"/>
  338. </Grid>
  339. </Grid>
  340. </Grid>
  341. </Grid>
  342. </Grid>
  343. </Window>