Scanner.xaml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <UserControl x:Class="DeviceScanner.Views.Scanner"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:DeviceScanner.Views"
  7. mc:Ignorable="d"
  8. xmlns:controls="clr-namespace:DeviceScanner.Controls"
  9. xmlns:UICommon="clr-namespace:UICommon;assembly=UICommon"
  10. d:DesignHeight="450" d:DesignWidth="800">
  11. <UserControl.Resources>
  12. <ResourceDictionary Source="/UICommon;component/Resources.xaml"/>
  13. </UserControl.Resources>
  14. <Grid Margin="8">
  15. <Grid.RowDefinitions>
  16. <RowDefinition Height="auto"/>
  17. <RowDefinition Height="16"/>
  18. <RowDefinition/>
  19. </Grid.RowDefinitions>
  20. <Grid >
  21. <Grid.ColumnDefinitions>
  22. <ColumnDefinition Width="auto"/>
  23. <ColumnDefinition Width="8"/>
  24. <ColumnDefinition Width="auto"/>
  25. <ColumnDefinition/>
  26. <ColumnDefinition Width="auto"/>
  27. </Grid.ColumnDefinitions>
  28. <Button Width="100" Height="32" Background="Transparent" BorderBrush="{StaticResource ThemeColor}" TextElement.Foreground="{StaticResource ThemeColor}"
  29. Command="{Binding ScanCommand}" CommandParameter="Start">开始扫描</Button>
  30. <Button Grid.Column="2" Width="100" Height="32" Margin="8,0" Background="Transparent" BorderBrush="{StaticResource EmergencyColor}" TextElement.Foreground="{StaticResource EmergencyColor}"
  31. Command="{Binding ScanCommand}" CommandParameter="Stop">停止扫描</Button>
  32. <Button Grid.Column="4" Width="100" Height="32" Margin="8,0" Background="Transparent" BorderBrush="{StaticResource ThemeColor}" TextElement.Foreground="{StaticResource ThemeColor}"
  33. Command="{Binding ScanCommand}" CommandParameter="Clear">清空列表</Button>
  34. </Grid>
  35. <Border Grid.Row="2" BorderBrush="{StaticResource DarkBorderColor}" BorderThickness="1">
  36. <Grid>
  37. <Grid Background="#50e1e1e1" Panel.ZIndex="1" Visibility="{Binding ShaderVisibility}">
  38. <UICommon:CycleRingLoading IsActive="{Binding EnableShader}" Width="100"/>
  39. </Grid>
  40. <ScrollViewer>
  41. <ItemsControl Margin="8" ItemsSource="{Binding ScanningDevices}">
  42. <ItemsControl.ItemTemplate>
  43. <DataTemplate>
  44. <controls:NewDevicePlot DeviceInfo="{Binding Value}"
  45. CreateCommand="{Binding RelativeSource={RelativeSource AncestorType=local:Scanner, Mode=FindAncestor}, Path=DataContext.CreateDeviceCommand}"/>
  46. </DataTemplate>
  47. </ItemsControl.ItemTemplate>
  48. <ItemsControl.ItemsPanel>
  49. <ItemsPanelTemplate>
  50. <WrapPanel/>
  51. </ItemsPanelTemplate>
  52. </ItemsControl.ItemsPanel>
  53. </ItemsControl>
  54. </ScrollViewer>
  55. </Grid>
  56. </Border>
  57. </Grid>
  58. </UserControl>