20211124_ZNZT_upperpc/MonitoringTechnology/Views/LYScanPage.xaml
2023-02-03 08:31:48 +08:00

64 lines
3.3 KiB
XML

<Window x:Class="MonitoringTechnology.Views.LYScanPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:MonitoringTechnology.Views"
mc:Ignorable="d"
Height="500" Width="750"
Title="蓝牙搜索" WindowStartupLocation="CenterScreen">
<Window.Resources>
<DataTemplate x:Key="DeviceTemplate">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Content="{Binding Name}" FontWeight="Bold" FontSize="18" Foreground="White" />
<StackPanel Grid.Row="1" Orientation="Horizontal" >
<Label Foreground="White">MAC</Label>
<Label Foreground="White" Content="{Binding Mac}"/>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" >
<Label Foreground="White">厂商数据</Label>
<Label Foreground="White" Content="{Binding MfrDataHex}"/>
</StackPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal">
<Label Foreground="White">RSSI</Label>
<Label Foreground="White" Content="{Binding RSSI}"/>
</StackPanel>
</Grid>
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.Background>
<RadialGradientBrush Center="0.5,0.7" GradientOrigin="0.5,0.7" RadiusY="0.8" RadiusX="0.8">
<GradientStop Color="#FFA4B3D3"/>
<GradientStop Color="#FF302C5D" Offset="0.952"/>
<GradientStop Color="#FF96AAD4" Offset="0.101"/>
</RadialGradientBrush>
</Grid.Background>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="27*"/>
<ColumnDefinition Width="289*"/>
<ColumnDefinition Width="184*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ListBox x:Name="deviceListBox" IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Devices}" ItemTemplate="{StaticResource DeviceTemplate}"
MouseDoubleClick="deviceListBox_MouseDoubleClick" Grid.ColumnSpan="3" Margin="0,0,0,48" Grid.RowSpan="2"/>
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" Grid.ColumnSpan="2" Grid.Column="1">
<Button x:Name="btnConnect" Margin="0, 10, 10, 10" Click="btnConnect_Click" Height="28" Width="150" FontSize="14">连接选中的设备</Button>
<Button x:Name="btnStartScan" Margin="0, 10, 10, 10" Click="btnStartScan_Click" Height="28" Width="90" FontSize="14">扫描设备</Button>
</StackPanel>
</Grid>
</Window>