DevicePlot.xaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <UserControl x:Class="DeviceManagement.Controls.DevicePlot"
  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:DeviceManagement.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" Width="360" Height="200">
  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.DeviceName}"/>
  34. <TextBlock Grid.Row="6" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=DeviceInfo.Position}"/>
  35. <Button Grid.Row="8" Height="32" Background="Transparent" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Width="120" BorderBrush="{StaticResource ThemeColor}"
  36. Command="{Binding ElementName=This, Path=DetailCommand}" CommandParameter="{Binding ElementName=This, Path=DeviceInfo}">
  37. <TextBlock Foreground="{StaticResource ThemeColor}" Margin="8,0">查看数据 →</TextBlock>
  38. </Button>
  39. </Grid>
  40. <Image Grid.Column="1" Source="{Binding ElementName=This, Path=DeviceInfo.DeviceModel, Converter={StaticResource ImageConverter}}" Stretch="Uniform"/>
  41. <Button Grid.Column="2" VerticalAlignment="Top" HorizontalAlignment="Right" Background="Transparent" BorderThickness="0"
  42. Command="{Binding ElementName=This, Path=SettingCommand}" CommandParameter="{Binding ElementName=This, Path=DeviceInfo}">
  43. <Image Source="{StaticResource Icon_SettingGear}" Height="24" />
  44. </Button>
  45. </Grid>
  46. </Border>
  47. </UserControl>