|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- <Metro:MetroWindow
- x:Class="IOT.Help.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:local="clr-namespace:IOT.Help"
- mc:Ignorable="d"
- xmlns:AduOpenLink="clr-namespace:AduSkin.Interactivity;assembly=AduSkin"
- xmlns:Metro="clr-namespace:AduSkin.Controls.Metro;assembly=AduSkin"
- Title="IOT助手" BorderThickness="0"
- MinWidth="600" MinHeight="350"
- d:DesignHeight="1200" d:DesignWidth="1600"
- xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
-
- Height="450" Width="800" Background="Transparent" WindowState="Maximized">
- <Metro:MetroWindow.Menu>
- <Metro:MetroTitleMenu Height="40">
- <Metro:MetroTitleMenuItem Header="联系">
- <Metro:MetroMenuItem Header="官网" Command="AduOpenLink:ControlCommands.OpenLink" CommandParameter="http://1.14.74.54/"/>
- <Metro:MetroMenuItem Header="邮箱" Command="AduOpenLink:ControlCommands.OpenLink" CommandParameter="mailto:1162129731@qq.com" />
- </Metro:MetroTitleMenuItem>
- </Metro:MetroTitleMenu>
- </Metro:MetroWindow.Menu>
-
- <Border >
- <Grid Margin="50">
- <TabControl >
- <TabItem Header=" 设备监视与管理 ">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="2*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <StackPanel Grid.Column="0" Margin="10">
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150">API查询地址:</TextBlock>
- <TextBox x:Name="apiurl" Margin="10,0,0,0" Width="200">https://bpa.black-pa.com:21527/datav</TextBox>
- <Button Tag="SetUrl" Margin="10,0,0,0" Click="Button_Click" >设置</Button>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150">客户端ID:</TextBlock>
- <TextBox x:Name="chen" Margin="10,0,0,0" Width="200" >1</TextBox>
- <Button Tag="Inquire" Margin="10,0,0,0" Click="Button_Click" >查询</Button>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150" HorizontalAlignment="Right" >客户端ID:</TextBlock>
- <TextBox x:Name="clientId" Margin="10,0,0,0" Width="200" Text="{Binding device.ClientId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150" HorizontalAlignment="Right" >设备ID:</TextBlock>
- <TextBox x:Name="DevId" Margin="10,0,0,0" Width="200" Text="{Binding device.DeviceId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150">devicename:</TextBlock>
- <TextBox x:Name="devicename" Margin="10,0,0,0" Width="200" Text="{Binding device.devicename, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150">productkey:</TextBlock>
- <TextBox x:Name="productkey" Margin="10,0,0,0" Width="200" Text="{Binding device.productkey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150">devicesecret:</TextBlock>
- <TextBox x:Name="devicesecret" Margin="10,0,0,0" Width="200" Text="{Binding device.devicesecret, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150">设备类型:</TextBlock>
- <TextBox x:Name="devtype" Margin="10,0,0,0" Width="200" Text="{Binding device.devtype, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150">经度:</TextBlock>
- <TextBox x:Name="jd" Margin="10,0,0,0" Width="200" Text="{Binding device.jd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150">纬度:</TextBlock>
- <TextBox x:Name="wd" Margin="10,0,0,0" Width="200" Text="{Binding device.wd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
- <TextBlock Width="150">备注:</TextBlock>
- <TextBox x:Name="remark" Margin="10,0,0,0" Width="200" Text="{Binding device.remark, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0" >
- <Button Margin="150,0,0,0" Tag="Add" Click="Button_Click">增加</Button>
- <Button Margin="20,0,0,0" Tag="Update" Click="Button_Click">修改</Button>
- <Button Margin="20,0,0,0" Tag="Delete" Click="Button_Click">删除</Button>
-
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="0,20,0,0" >
- <Button Margin="150,0,0,0" Tag="Save" Click="Button_Click">保存text</Button>
- <Button Margin="20,0,0,0" Tag="Insert" Click="Button_Click">导入text</Button>
- </StackPanel>
-
- </StackPanel>
-
- <Grid Grid.Column="1" Margin="10">
- <DataGrid HorizontalScrollBarVisibility="Visible" Margin="10" SelectedItem="{Binding deviceTableSelectedItem, UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding deviceTable, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" MouseDoubleClick="DataGrid_MouseDoubleClick">
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="客户端ID" Width="3*">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock HorizontalAlignment="Center" Text="{Binding ClientId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="阿里云设备名称" Width="6.4*">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock HorizontalAlignment="Center" Text="{Binding devicename, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="阿里云设备key" Width="6.4*">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock HorizontalAlignment="Center" Text="{Binding productkey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="阿里云设备secret" Width="6.4*">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock HorizontalAlignment="Center" Text="{Binding devicesecret, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="客户端类型" Width="4*">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock HorizontalAlignment="Center" Text="{Binding devtype, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="经度" Width="4.4*">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock HorizontalAlignment="Center" Text="{Binding jd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="纬度" Width="4.4*">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock HorizontalAlignment="Center" Text="{Binding wd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="备注" Width="8.4*">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock HorizontalAlignment="Center" Text="{Binding remark, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </DataGrid>
-
- </Grid>
- </Grid>
- </TabItem>
- <TabItem Header=" 设备模拟上报 ">
- <Grid>
-
- </Grid>
- </TabItem>
- <TabItem Header=" 测试轮播 ">
- <Grid >
- <StackPanel Orientation="Vertical">
- <Metro:CoverFlow Margin="0,100,0,0" HorizontalAlignment="Center" x:Name="CoverFlowMain" Width="500" Height="200">
- <Metro:CoverFlow.ItemTemplate>
- <DataTemplate>
- <Image x:Name="cover" Source="{Binding imgpath}" Stretch="UniformToFill"/>
- </DataTemplate>
- </Metro:CoverFlow.ItemTemplate>
- </Metro:CoverFlow>
- <Metro:Carousel x:Name="Carousels" AutoPlay="True" AutoPlaySpeed="5000" Height="350" Width="500" VerticalAlignment="Center" HorizontalAlignment="Center">
- <Metro:Carousel.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Image x:Name="cover" RenderTransformOrigin="0.5,0.5" Source="{Binding imgpath}" Stretch="UniformToFill" >
- <Image.RenderTransform>
- <TransformGroup>
- <ScaleTransform ScaleX="1" ScaleY="1" />
- </TransformGroup>
- </Image.RenderTransform>
- </Image>
- <Metro:AduButtonIcon
- x:Name="PlayBtn"
- Background="Transparent"
- Margin="10,50" Width="60"
- HorizontalAlignment="Right" VerticalAlignment="Bottom"
- Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}, Path=DataContext.PlayRecommendClick}"
- CommandParameter="{Binding}"
- Foreground="#fff"
- Icon="{StaticResource Icon_Desgin}"
- IconHeight="16"
- IconWidth="25"
- Visibility="Hidden" />
-
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,50">
- <TextBlock Text="{Binding name}" Background="#50000000" Padding="6,0" Foreground="#FFF" FontSize="20" FontWeight="Bold" HorizontalAlignment="Center" MaxWidth="300" TextTrimming="CharacterEllipsis"/>
- <TextBlock Text="{Binding info}" Background="#50000000" Padding="6,2" Foreground="#FFF" FontSize="14" HorizontalAlignment="Center" MaxWidth="300" TextTrimming="CharacterEllipsis"/>
- </StackPanel>
-
- </Grid>
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="PlayBtn" Property="Visibility" Value="Visible" />
- </Trigger>
-
- <!--鼠标进入事件-->
-
- <EventTrigger RoutedEvent="UIElement.MouseEnter">
- <BeginStoryboard>
- <Storyboard>
- <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" />
- <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" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
-
- <!--鼠标离开事件-->
-
- <EventTrigger RoutedEvent="UIElement.MouseLeave">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="cover" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" To="1" Duration="0:0:0.3" AutoReverse="False" />
- <DoubleAnimation Storyboard.TargetName="cover" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" To="1" Duration="0:0:0.3" AutoReverse="False" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </Metro:Carousel.ItemTemplate>
- </Metro:Carousel>
- </StackPanel>
- </Grid>
- </TabItem>
-
- </TabControl>
- </Grid>
- </Border>
- </Metro:MetroWindow>
|