NewDevicePlot.xaml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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="*"/>
  29. <RowDefinition Height="auto"/>
  30. </Grid.RowDefinitions>
  31. <TextBlock Grid.Row="0" FontSize="18" Text="{Binding ElementName=This, Path=DeviceInfo.DeviceModel}"/>
  32. <TextBlock Grid.Row="2" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=DeviceInfo.DeviceSubModel}"/>
  33. <TextBlock Grid.Row="4" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=DeviceInfo.IP}"/>
  34. <TextBlock Grid.Row="6" VerticalAlignment="Center" >
  35. <Run>Ver:</Run>
  36. <Run Text="{Binding ElementName=This, Path=DeviceInfo.SoftwareVersion}"/>
  37. </TextBlock>
  38. <Button Grid.Row="8" Height="32" Background="Transparent" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Width="120" BorderBrush="{StaticResource ThemeColor}"
  39. Command="{Binding ElementName=This, Path=CreateCommand}" CommandParameter="{Binding ElementName=This, Path=DeviceInfo}">
  40. <TextBlock Foreground="{StaticResource ThemeColor}" Margin="8,0">添加设备</TextBlock>
  41. </Button>
  42. </Grid>
  43. <Image Grid.Column="1" Width="180" Source="{Binding ElementName=This, Path=DeviceInfo.DeviceModel, Converter={StaticResource ImageConverter}}" Stretch="Uniform"/>
  44. </Grid>
  45. </Border>
  46. </UserControl>