You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

255 lines
18 KiB

  1. <Metro:MetroWindow
  2. x:Class="IOT.Help.MainWindow"
  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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:local="clr-namespace:IOT.Help"
  8. mc:Ignorable="d"
  9. xmlns:AduOpenLink="clr-namespace:AduSkin.Interactivity;assembly=AduSkin"
  10. xmlns:Metro="clr-namespace:AduSkin.Controls.Metro;assembly=AduSkin"
  11. Title="IOT助手" BorderThickness="0"
  12. MinWidth="600" MinHeight="350"
  13. d:DesignHeight="1200" d:DesignWidth="1600"
  14. xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
  15. Height="450" Width="800" Background="Transparent" WindowState="Maximized">
  16. <Metro:MetroWindow.Menu>
  17. <Metro:MetroTitleMenu Height="40">
  18. <Metro:MetroTitleMenuItem Header="联系">
  19. <Metro:MetroMenuItem Header="官网" Command="AduOpenLink:ControlCommands.OpenLink" CommandParameter="http://1.14.74.54/"/>
  20. <Metro:MetroMenuItem Header="邮箱" Command="AduOpenLink:ControlCommands.OpenLink" CommandParameter="mailto:1162129731@qq.com" />
  21. </Metro:MetroTitleMenuItem>
  22. </Metro:MetroTitleMenu>
  23. </Metro:MetroWindow.Menu>
  24. <Border >
  25. <Grid Margin="50">
  26. <TabControl >
  27. <TabItem Header=" 设备监视与管理 ">
  28. <Grid>
  29. <Grid.ColumnDefinitions>
  30. <ColumnDefinition Width="*"></ColumnDefinition>
  31. <ColumnDefinition Width="2*"></ColumnDefinition>
  32. </Grid.ColumnDefinitions>
  33. <StackPanel Grid.Column="0" Margin="10">
  34. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  35. <TextBlock Width="150">API查询地址:</TextBlock>
  36. <TextBox x:Name="apiurl" Margin="10,0,0,0" Width="200">http://111.9.47.105:21527/datav</TextBox>
  37. <Button Tag="SetUrl" Margin="10,0,0,0" Click="Button_Click" >设置</Button>
  38. </StackPanel>
  39. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  40. <TextBlock Width="150">客户端ID:</TextBlock>
  41. <TextBox x:Name="chen" Margin="10,0,0,0" Width="200" >1</TextBox>
  42. <Button Tag="Inquire" Margin="10,0,0,0" Click="Button_Click" >查询</Button>
  43. </StackPanel>
  44. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  45. <TextBlock Width="150" HorizontalAlignment="Right" >客户端ID:</TextBlock>
  46. <TextBox x:Name="clientId" Margin="10,0,0,0" Width="200" Text="{Binding device.ClientId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  47. </StackPanel>
  48. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  49. <TextBlock Width="150" HorizontalAlignment="Right" >设备ID:</TextBlock>
  50. <TextBox x:Name="DevId" Margin="10,0,0,0" Width="200" Text="{Binding device.DeviceId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  51. </StackPanel>
  52. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  53. <TextBlock Width="150">devicename:</TextBlock>
  54. <TextBox x:Name="devicename" Margin="10,0,0,0" Width="200" Text="{Binding device.devicename, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  55. </StackPanel>
  56. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  57. <TextBlock Width="150">productkey:</TextBlock>
  58. <TextBox x:Name="productkey" Margin="10,0,0,0" Width="200" Text="{Binding device.productkey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  59. </StackPanel>
  60. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  61. <TextBlock Width="150">devicesecret:</TextBlock>
  62. <TextBox x:Name="devicesecret" Margin="10,0,0,0" Width="200" Text="{Binding device.devicesecret, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  63. </StackPanel>
  64. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  65. <TextBlock Width="150">设备类型:</TextBlock>
  66. <TextBox x:Name="devtype" Margin="10,0,0,0" Width="200" Text="{Binding device.devtype, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  67. </StackPanel>
  68. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  69. <TextBlock Width="150">经度:</TextBlock>
  70. <TextBox x:Name="jd" Margin="10,0,0,0" Width="200" Text="{Binding device.jd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  71. </StackPanel>
  72. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  73. <TextBlock Width="150">纬度:</TextBlock>
  74. <TextBox x:Name="wd" Margin="10,0,0,0" Width="200" Text="{Binding device.wd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  75. </StackPanel>
  76. <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
  77. <TextBlock Width="150">备注:</TextBlock>
  78. <TextBox x:Name="remark" Margin="10,0,0,0" Width="200" Text="{Binding device.remark, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  79. </StackPanel>
  80. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" >
  81. <Button Margin="150,0,0,0" Tag="Add" Click="Button_Click">增加</Button>
  82. <Button Margin="20,0,0,0" Tag="Update" Click="Button_Click">修改</Button>
  83. <Button Margin="20,0,0,0" Tag="Delete" Click="Button_Click">删除</Button>
  84. </StackPanel>
  85. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" >
  86. <Button Margin="150,0,0,0" Tag="Save" Click="Button_Click">保存text</Button>
  87. <Button Margin="20,0,0,0" Tag="Insert" Click="Button_Click">导入text</Button>
  88. </StackPanel>
  89. </StackPanel>
  90. <Grid Grid.Column="1" Margin="10">
  91. <DataGrid HorizontalScrollBarVisibility="Visible" Margin="10" SelectedItem="{Binding deviceTableSelectedItem, UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding deviceTable, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" MouseDoubleClick="DataGrid_MouseDoubleClick">
  92. <DataGrid.Columns>
  93. <DataGridTemplateColumn Header="客户端ID" Width="3*">
  94. <DataGridTemplateColumn.CellTemplate>
  95. <DataTemplate>
  96. <TextBlock HorizontalAlignment="Center" Text="{Binding ClientId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
  97. </DataTemplate>
  98. </DataGridTemplateColumn.CellTemplate>
  99. </DataGridTemplateColumn>
  100. <DataGridTemplateColumn Header="阿里云设备名称" Width="6.4*">
  101. <DataGridTemplateColumn.CellTemplate>
  102. <DataTemplate>
  103. <TextBlock HorizontalAlignment="Center" Text="{Binding devicename, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
  104. </DataTemplate>
  105. </DataGridTemplateColumn.CellTemplate>
  106. </DataGridTemplateColumn>
  107. <DataGridTemplateColumn Header="阿里云设备key" Width="6.4*">
  108. <DataGridTemplateColumn.CellTemplate>
  109. <DataTemplate>
  110. <TextBlock HorizontalAlignment="Center" Text="{Binding productkey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
  111. </DataTemplate>
  112. </DataGridTemplateColumn.CellTemplate>
  113. </DataGridTemplateColumn>
  114. <DataGridTemplateColumn Header="阿里云设备secret" Width="6.4*">
  115. <DataGridTemplateColumn.CellTemplate>
  116. <DataTemplate>
  117. <TextBlock HorizontalAlignment="Center" Text="{Binding devicesecret, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
  118. </DataTemplate>
  119. </DataGridTemplateColumn.CellTemplate>
  120. </DataGridTemplateColumn>
  121. <DataGridTemplateColumn Header="客户端类型" Width="4*">
  122. <DataGridTemplateColumn.CellTemplate>
  123. <DataTemplate>
  124. <TextBlock HorizontalAlignment="Center" Text="{Binding devtype, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
  125. </DataTemplate>
  126. </DataGridTemplateColumn.CellTemplate>
  127. </DataGridTemplateColumn>
  128. <DataGridTemplateColumn Header="经度" Width="4.4*">
  129. <DataGridTemplateColumn.CellTemplate>
  130. <DataTemplate>
  131. <TextBlock HorizontalAlignment="Center" Text="{Binding jd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
  132. </DataTemplate>
  133. </DataGridTemplateColumn.CellTemplate>
  134. </DataGridTemplateColumn>
  135. <DataGridTemplateColumn Header="纬度" Width="4.4*">
  136. <DataGridTemplateColumn.CellTemplate>
  137. <DataTemplate>
  138. <TextBlock HorizontalAlignment="Center" Text="{Binding wd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
  139. </DataTemplate>
  140. </DataGridTemplateColumn.CellTemplate>
  141. </DataGridTemplateColumn>
  142. <DataGridTemplateColumn Header="备注" Width="8.4*">
  143. <DataGridTemplateColumn.CellTemplate>
  144. <DataTemplate>
  145. <TextBlock HorizontalAlignment="Center" Text="{Binding remark, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
  146. </DataTemplate>
  147. </DataGridTemplateColumn.CellTemplate>
  148. </DataGridTemplateColumn>
  149. </DataGrid.Columns>
  150. </DataGrid>
  151. </Grid>
  152. </Grid>
  153. </TabItem>
  154. <TabItem Header=" 设备模拟上报 ">
  155. <Grid>
  156. </Grid>
  157. </TabItem>
  158. <TabItem Header=" 测试轮播 ">
  159. <Grid >
  160. <StackPanel Orientation="Vertical">
  161. <Metro:CoverFlow Margin="0,100,0,0" HorizontalAlignment="Center" x:Name="CoverFlowMain" Width="500" Height="200">
  162. <Metro:CoverFlow.ItemTemplate>
  163. <DataTemplate>
  164. <Image x:Name="cover" Source="{Binding imgpath}" Stretch="UniformToFill"/>
  165. </DataTemplate>
  166. </Metro:CoverFlow.ItemTemplate>
  167. </Metro:CoverFlow>
  168. <Metro:Carousel x:Name="Carousels" AutoPlay="True" AutoPlaySpeed="5000" Height="350" Width="500" VerticalAlignment="Center" HorizontalAlignment="Center">
  169. <Metro:Carousel.ItemTemplate>
  170. <DataTemplate>
  171. <Grid>
  172. <Image x:Name="cover" RenderTransformOrigin="0.5,0.5" Source="{Binding imgpath}" Stretch="UniformToFill" >
  173. <Image.RenderTransform>
  174. <TransformGroup>
  175. <ScaleTransform ScaleX="1" ScaleY="1" />
  176. </TransformGroup>
  177. </Image.RenderTransform>
  178. </Image>
  179. <Metro:AduButtonIcon
  180. x:Name="PlayBtn"
  181. Background="Transparent"
  182. Margin="10,50" Width="60"
  183. HorizontalAlignment="Right" VerticalAlignment="Bottom"
  184. Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}, Path=DataContext.PlayRecommendClick}"
  185. CommandParameter="{Binding}"
  186. Foreground="#fff"
  187. Icon="{StaticResource Icon_Desgin}"
  188. IconHeight="16"
  189. IconWidth="25"
  190. Visibility="Hidden" />
  191. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,50">
  192. <TextBlock Text="{Binding name}" Background="#50000000" Padding="6,0" Foreground="#FFF" FontSize="20" FontWeight="Bold" HorizontalAlignment="Center" MaxWidth="300" TextTrimming="CharacterEllipsis"/>
  193. <TextBlock Text="{Binding info}" Background="#50000000" Padding="6,2" Foreground="#FFF" FontSize="14" HorizontalAlignment="Center" MaxWidth="300" TextTrimming="CharacterEllipsis"/>
  194. </StackPanel>
  195. </Grid>
  196. <DataTemplate.Triggers>
  197. <Trigger Property="IsMouseOver" Value="True">
  198. <Setter TargetName="PlayBtn" Property="Visibility" Value="Visible" />
  199. </Trigger>
  200. <!--鼠标进入事件-->
  201. <EventTrigger RoutedEvent="UIElement.MouseEnter">
  202. <BeginStoryboard>
  203. <Storyboard>
  204. <DoubleAnimation Storyboard.TargetName="cover" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From="1" To="1.1" Duration="0:0:0.3" AutoReverse="False" />
  205. <DoubleAnimation Storyboard.TargetName="cover" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From="1" To="1.1" Duration="0:0:0.3" AutoReverse="False" />
  206. </Storyboard>
  207. </BeginStoryboard>
  208. </EventTrigger>
  209. <!--鼠标离开事件-->
  210. <EventTrigger RoutedEvent="UIElement.MouseLeave">
  211. <BeginStoryboard>
  212. <Storyboard>
  213. <DoubleAnimation Storyboard.TargetName="cover" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" To="1" Duration="0:0:0.3" AutoReverse="False" />
  214. <DoubleAnimation Storyboard.TargetName="cover" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" To="1" Duration="0:0:0.3" AutoReverse="False" />
  215. </Storyboard>
  216. </BeginStoryboard>
  217. </EventTrigger>
  218. </DataTemplate.Triggers>
  219. </DataTemplate>
  220. </Metro:Carousel.ItemTemplate>
  221. </Metro:Carousel>
  222. </StackPanel>
  223. </Grid>
  224. </TabItem>
  225. </TabControl>
  226. </Grid>
  227. </Border>
  228. </Metro:MetroWindow>