SearchDeviceWindow.xaml 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <hc:Window x:Class="TeamAAS.Views.SearchDeviceWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:loc="clr-namespace:TeamAAS.Localization"
  5. Title="{loc:Translate '搜索相机设备'}" Width="560" Height="480"
  6. WindowStartupLocation="CenterOwner" ResizeMode="NoResize"
  7. Background="{DynamicResource RegionBrush}"
  8. Closing="Window_Closing"
  9. ShowInTaskbar="False">
  10. <Grid Margin="16">
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="Auto"/>
  13. <RowDefinition Height="Auto"/>
  14. <RowDefinition Height="*"/>
  15. <RowDefinition Height="Auto"/>
  16. </Grid.RowDefinitions>
  17. <!-- 品牌选择 + 搜索 -->
  18. <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,12">
  19. <TextBlock Text="{loc:Translate '相机品牌:'}" FontSize="14" VerticalAlignment="Center"
  20. Foreground="{DynamicResource PrimaryTextBrush}"/>
  21. <ComboBox x:Name="BrandComboBox" Width="200" Margin="8,0,0,0" FontSize="13"
  22. DisplayMemberPath="DisplayName" SelectedValuePath="Brand"/>
  23. <Button Content="{loc:Translate '搜索'}" Click="Search_Click" Margin="12,0,0,0" Padding="20,6"
  24. Style="{StaticResource ButtonPrimary}"/>
  25. </StackPanel>
  26. <!-- 搜索状态 -->
  27. <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,8">
  28. <TextBlock x:Name="StatusText" FontSize="12"
  29. Foreground="{DynamicResource SecondaryTextBrush}" VerticalAlignment="Center"/>
  30. <hc:LoadingCircle x:Name="LoadingIndicator" Width="16" Height="16" Margin="8,0,0,0"
  31. Visibility="Collapsed"/>
  32. </StackPanel>
  33. <!-- 搜索结果 -->
  34. <Border Grid.Row="2" Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="8">
  35. <ListBox x:Name="ResultListBox" Background="Transparent" BorderThickness="0"
  36. Margin="8" SelectionChanged="Result_SelectionChanged">
  37. <ListBox.ItemTemplate>
  38. <DataTemplate>
  39. <Border Padding="12,8" CornerRadius="6"
  40. Background="{DynamicResource SecondaryRegionBrush}" Margin="0,2">
  41. <StackPanel>
  42. <StackPanel Orientation="Horizontal">
  43. <TextBlock Text="{Binding CameraBrandDisplay}" FontSize="12"
  44. FontWeight="Bold" Foreground="{DynamicResource PrimaryBrush}"/>
  45. <TextBlock Text="{Binding Model}" FontSize="12" Margin="8,0,0,0"
  46. Foreground="{DynamicResource PrimaryTextBrush}"/>
  47. </StackPanel>
  48. <TextBlock FontSize="11" Margin="0,4,0,0"
  49. Foreground="{DynamicResource SecondaryTextBrush}">
  50. <Run Text="IP: "/><Run Text="{Binding CameraIp, Mode=OneWay}"/>
  51. <Run Text=" SN: "/><Run Text="{Binding SerialNumber, Mode=OneWay}"/>
  52. </TextBlock>
  53. </StackPanel>
  54. </Border>
  55. </DataTemplate>
  56. </ListBox.ItemTemplate>
  57. </ListBox>
  58. </Border>
  59. <!-- 底部按钮 -->
  60. <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
  61. <Button Content="{loc:Translate '添加选中设备'}" Click="Add_Click" Padding="20,6" Margin="0,0,8,0"
  62. Style="{StaticResource ButtonPrimary}" x:Name="AddButton" IsEnabled="False"/>
  63. <Button Content="{loc:Translate '关闭'}" Click="Close_Click" Padding="20,6"
  64. Style="{StaticResource ButtonDefault}"/>
  65. </StackPanel>
  66. </Grid>
  67. </hc:Window>