NewDevicePlot.xaml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <UserControl x:Class="DeviceScanner.Controls.NewDevicePlot"
  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.Controls"
  7. mc:Ignorable="d"
  8. x:Name="This"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <UserControl.Resources>
  11. <local:DeviceImageConverter x:Key="ImageConverter"/>
  12. </UserControl.Resources>
  13. <Border BorderBrush="DarkGray" Background="#f2f2f2" CornerRadius="16" BorderThickness="1" Margin="8">
  14. <Grid Margin="12,8">
  15. <Grid.ColumnDefinitions>
  16. <ColumnDefinition Width="120"/>
  17. <ColumnDefinition/>
  18. </Grid.ColumnDefinitions>
  19. <Grid Margin="0,8">
  20. <Grid.RowDefinitions>
  21. <RowDefinition Height="auto"/>
  22. <RowDefinition Height="4"/>
  23. <RowDefinition Height="auto"/>
  24. <RowDefinition Height="8"/>
  25. <RowDefinition Height="auto"/>
  26. <RowDefinition Height="4"/>
  27. <RowDefinition Height="auto"/>
  28. <RowDefinition Height="4"/>
  29. <RowDefinition Height="auto"/>
  30. <RowDefinition Height="4"/>
  31. <RowDefinition Height="auto"/>
  32. <RowDefinition Height="*"/>
  33. <RowDefinition Height="auto"/>
  34. </Grid.RowDefinitions>
  35. <TextBlock Grid.Row="0" FontSize="18" Text="{Binding ElementName=This, Path=DeviceInfo.DeviceModel}"/>
  36. <TextBlock Grid.Row="2" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=DeviceInfo.DeviceSubModel}"/>
  37. <TextBlock Grid.Row="4" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=DeviceInfo.DeviceName}"/>
  38. <TextBlock Grid.Row="6" VerticalAlignment="Center">
  39. <Run Text="{Binding ElementName=This, Path=DeviceInfo.IP}"></Run>
  40. <Run>:</Run>
  41. <Run Text="{Binding ElementName=This, Path=DeviceInfo.Port}"></Run>
  42. </TextBlock>
  43. <TextBlock Grid.Row="8" VerticalAlignment="Center" >
  44. <Run>Ver:</Run>
  45. <Run Text="{Binding ElementName=This, Path=DeviceInfo.SoftwareVersion}"/>
  46. </TextBlock>
  47. <Button Grid.Row="12" Height="32" Background="Transparent" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Width="120" BorderBrush="{StaticResource ThemeColor}"
  48. Command="{Binding ElementName=This, Path=CreateCommand}" CommandParameter="{Binding ElementName=This, Path=DeviceInfo}">
  49. <TextBlock Foreground="{StaticResource ThemeColor}" Margin="8,0">添加设备</TextBlock>
  50. </Button>
  51. </Grid>
  52. <Image Grid.Column="1" Width="180" Source="{Binding ElementName=This, Path=DeviceInfo.DeviceModel, Converter={StaticResource ImageConverter}}" Stretch="Uniform"/>
  53. </Grid>
  54. </Border>
  55. </UserControl>